- Home /
Problem is not reproducible or outdated
The Walking Dead Game Animation Style
Hi, I am trying to accomplish so that at a certain point in the game, I can press a key (W) and it will play the animation onwards until I stop holding the key. This effect has been seen in The Walking Dead Game made by Telltale games, released april 24th 2012. Here's an example of what I mean : Link to example video
Yesterday, april 26th 2013, I found a way to accomplish this with a javascript. But I also discovered a problem when I have release the key and pressing it again, the animation buffers some frames forward in time, and I don't want that. Here is my script :
var TestObject : GameObject;
function Update () {
if(Input.GetKey("w")){
TestObject.animation.Play();
TestObject.animation.enabled = true;
}
else
if(!Input.GetKey("w")){
TestObject.animation.enabled = false;
}
}
How can I make the animation resume smoothly from the last frame instead of just buffering a couple of frames forward?
Sounds fun.
Unfortunately, you didn't include a question, so we can't help you.
Answer by FlameCow · Apr 26, 2013 at 05:39 PM
In pseudocode, you might be able to do something like
if button.isDown { animation.play } else { animation.stop }
Hopefully this helps!
Follow this Question
Related Questions
function Start () problem!! 3 Answers
"Instantiate"/make new function via script? 1 Answer
Animay play in editor 0 Answers
What does one language have over the other? (functionality) 2 Answers
how to get a animation from other script on colision 1 Answer