- Home /
How would I script a simple path animation in C#
I want to make a movement animation script to move an object from point a to point b to point c and so on, with different durations for each. How would I do this ?
Answer by ProudOne · Jul 08, 2012 at 12:11 PM
Have a look at Animations via YieldInstructions. There's a bunch of tutorials out there for that. You may be able to use an array to store the waypoints (as Transforms) and then Lerp your object between those Transforms.
Yes, I was going to use arrays to store waypoints and durations. Yield can be useful as an alternate to stop movement, but I was looking for how to store and use the time taken to go between the two points. For example how would I code it so that it takes an object 2.3 seconds to move from point a to point b. Lerp does that eg Vector3.Lerp
Thanks !
Last one was a good question for me as well. Can`t vote yet
Your answer
Follow this Question
Related Questions
Script on moving object doesn't work? 1 Answer
Stopping all movement along axis? 1 Answer
Help with mouse and keyboard movement. 0 Answers
how to make your own character. 2 Answers
Bomberman movement script? 1 Answer