Hi,
This is something I want clarification on before the question:
Lets say an Object is travelling at 3 studs per second, and the destination is 6 studs away, I can just do the simple calulation of time to get the amount of seconds needed which is:
time = distance/speed
or in this case:
time = 6/3
I can then tell the code to Interpolate this number by addingdeltaTime
and then dividingdeltaTime
withtime
, however when adding, I want to apply a limit to the amount of time that can be added:
current = math.min(current + deltaTime, time)
transition = current/time
object.Position = p0:Lerp(p1, transition)
This should then give the result I wanted for a Linear Interpolation at a constant speed.
But how will I do this with more than 2 points, where instead of a linear path, its a path that curves a specific way, and if instead of having to calulate the transition to 2 points, I would have to do multiple.
Note: I’m trying to apply these Changes with
AlignPosition
andAlignOrientation
which may be an issue.
I might be overthinking this a bit, so sorry if im just wasting your time.