Find position between of two positions depending on time

I have two positions.

Pos1 = Vector3.new(-5,1,10)
Pos2 = Vector3.new(20,5,12)

These positions are random. These are not the actual positions. I also have 2 times.

TimePassed = 5
TimeTotal = 12

Pos1 is the starting location. Pos2 is the ending location. I have a part that takes a certain amount of time to get from pos1 and pos2 (TimeTotal). I would like to find the location between the 2 positions depending on the time passed and time total. So with these times, it would be 5/12 of the way to point 2.

Can you clarify what you mean? What are you attempting to accomplish?

does So with these times, it would be 5/12 of the way to point 2 help?

You can use Pos1:Lerp(Pos2, timePassed / timeTotal)

2 Likes

So you’re attempting to find out how long it takes to get from point a to b based on a time or are you attempting to see how far someone can move with a certain time?

5/12 of the way from Pos1 to Pos2 is Pos1:Lerp(Pos2, 5/12), or Pos2*5/12 + Pos1*(1 - 5/12)

1 Like

I am trying to get the location between the points depending on how much time has passed and how much time it takes for them to get to the point

1 Like

Ah okay, I believe Defaultio and 1waffle1 answered your question then.