Object moving

Hello am gonna make a game but i have a problem with my AI. İ want to make it moves as i want. How can i do the AI goes one point to another? For excample if it stops the point x0 and y0 (50,50) and i want to move it to x1 and y1 (70,80) with a spesific step excample it move one by one with a constant speed not teleporting. My map coordinates for x 0 - 1024 and for y 0 - 600. If you help me i would be happy thx.

Answers

  • Simply use linear interpolation. If you want the animation to take ten steps, then do (70-50) = 20 distance in ten steps so 2 distance per step for horizontal and (50-80) = -30 so -3 distance per step for vertical.

Sign In or Register to comment.