Move spatial to a specific point

Hello,
I am new to JMonkey and I am trying to do the simpliest thing in the world: to move a spatial from (0.0f, 0.0f, 0.0f) to

(0.0f, 0.0f, 1.0f) having a smooth movement. So I extend AbstractControl and I try something like this:

public class MyAbstractControl extends AbstractControl{
private Vector3f target;
private int direction;
private float tpf;

public void move(){
Vector3f start = spatial.getLocalTranslation();
spatial.setLocalTranslation(start.interpolate(target, tpf/start.distance(target)));
System.out.println("spatial.getLocalTranslation() = " + spatial.getLocalTranslation());
}

protected void controlUpdate(float tpf){
this.tpf = tpf;
if(spatial != null)
move();
}
}

the problem is that the spatial doesn’t stay at (0.0f, 0.0f, 1.0f) but goes between (0.0, 0.0, 0.9992296) and (0.0, 0.0, 1.0024321) (the numbers are random each time) forever! What should I do? And what is the best way to do that?

Edit:NVM

you’ll need to add an if statement like

[java]
if(distance<0.1f){
spatial.setlocaltranslation(target):
}else{
spatial.setLocalTranslation(start.interpolate(target, tpf/start.distance(target)));
}

[/java]

because the object moves in increments according to tpf. itll never land on exactly 1.0f

yes, I ve seen this on an other post but I thought there was a more elegant way. I ll go with this solution. Thank you!