2021年3月29日星期一

How should I calculate the speed of a Lerp?

I have a Vector2 Lerp statement:

Vector2.Lerp(spawnPos, target, position);  

The position variable is a number between 0 and 1, and for all intents and purposes, it increments over time. Think of the way I'm tracking position as a "playhead," like in music or animation, where a cursor moves from left to right as the playback continues.

I want the object to continue moving after it reaches its target, at the same EXACT speed, just infinitely in a direction. I've tried to change the target to the direction multiplied by the distance between the spawn point, but I still can't figure out how to get the correct speed.

https://stackoverflow.com/questions/66863654/how-should-i-calculate-the-speed-of-a-lerp March 30, 2021 at 09:28AM

没有评论:

发表评论