• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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