Here’s my problem,
I’m moving a character with Vector3.Lerp() and when he’s 1.2 seconds away from reaching his destination I want to play an animation.
So I’m trying to figure out how to calculate this and it’s got me stumped.
This is what I got so far:
// time passed since character began moving
float timePassed = Time.time - startTime;
// distance traveled since the character began moving
float distance = transform.position.z - startPos.z;
Now say I Do
float speed = distance - timePassed;
that will give me units/sec ?
Then to get the distance between the current position and the destination
float remainingDistance = destination.z - transform.position.z;
Now I’m stuck, I feel like I have all the pieces I’m just not sure how to put them together.