pingpong animation question

Hello,

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:

animation.Play("ClipNameHere");
if (Input.GetKey ("space")){
     animation["ClipNameHere"].speed = 1;
}else{
     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:

Scribe

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