- Home /
Play half of Animation on KeyDown/Other Half on KeyUp
Hello,
So I've been searching around haven't found anything about being able to play the animation that I want.
So when the user presses a button in my game, it will play half of the animation and STAY paused at the end of the half of the animation. But if the user is to release the button, it will then play the next the next half of the animation.
So I'll give it a go:
function Update() { if(Input.GetKeyDown(KeyCode.Q)) { animation.Play("LBehind",PlayMode.StopAll); } else(Input.GetKeyUp animation.Play("LBehind" }
I already know it's wrong.. If anyone can help me, I'd really appreciate it.
Answer by JeffBC · Jan 17, 2014 at 05:26 AM
It's probably easier to split that animation in two, then playing the first one once when the user press the key and play the second one when the key is released
You are correct haha, I don't know why I had to make it so complicated.. As for that, I am still not aware of the script and how to do it. But now I'm going to start looking. I will report back if I have found something that works.
Your answer
Follow this Question
Related Questions
Can/how do I set up a boolean to continue an animation after button press 1 Answer
problem not playing animation on keyDown 2 Answers
Crazy weird input script order glitch please help! 1 Answer
Walking and Running Script not working. 1 Answer
Run Sprint animation and stop it when button is released 1 Answer