pingpong animation question


How do I get an animation to play all the way through to the end while a key is pressed, and then after the key is released, rewind back to the beginning?

I haven’t tested this so it may be completely wrong however I would guess you could do:

if (Input.GetKey ("space")){
     animation["ClipNameHere"].speed = 1;
     animation["ClipNameHere"].speed = -1;

sorry if this isn’t correct! As I said this isn’t tested and I haven’t used many animations lately :slight_smile:


Bunny your sample project is exactly what I needed! thank you