I feel really stupid asking this. I have a simple 2d platformer. Inside the game I have pipes that I want the player to ride. Basically I have set up a system of PoinfF for each unit it needs to travel. My issue is having smooth travel between them. Can someone write a simple function where I could input point a and point b a then a number between 0 and 1 specifying how along the line it is? Basically I would call the function each frame and set eh cameras position to its output.
I have searched many forms here and I can't find one that works, or I can not understand the math inside. I am sorry to ask this as to you guys it has already been answered.
In summary I am hoping one of you will write me a simple function. It would start with. PointF interpolate (PointF 1, PointF 2, value between 0 and 1)
Btw you do not have to stress over performance this is an amateur game.
Also if there is a good way to make the function accept multiple points that would be great!