Object move using a variable as time

V

Vito_Curse

Guest
I couldn't find anywhere someone trying to do this, but I have a radar in my game, the radar is a straight line with a ball on it, this ball needs to travel all the way throough the line up to its end but only reach the end when the stage is completed!

I have a time variable for each stage, for example 1000
I guess I have to use "lerp" but I can't seem to get it to work properly.

This is what I got for now:
x=lerp(x,obj_radar.x+50,3/timer)

the ball moves from x (being 0) to the radar's final point using 3/time remaining as the speed.

Any idea what I'm doing wrong?
 
Top