How do you make a moveTo function?

I want to make a strategy game and I’m running into some problems here. I have not found a moveTo function that will gradually move an object to a set of cordinates. I’m guess I would have to write my own code for this. I am able to so far get the world cordinates on mouse click, and set local translation of an object to those coordinates but it sets the object instantly how would I make it so that the object would gradually move straight to the target area?



btw I have searched the forums and only found one topic on this which used some kind of outdated code and they didn’t even post the full code

well baiscally you have to update everyframe/everylogictick the position of your unit towards the target.

(set transition towards target with their speed they should move)

empirephoenix is there an actual function already made to gradually move an item to a given coordinates?



I have found a solution, i used a few formula to calculate everything, works pretty good so far.



Im sure others have searched for this in the past or will, so I will post the solution tomorrow

There is a Linear interpolation function in the FastMath class that can help you to do this.