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.
– Julien-LyngeIt will at least be extremely hard to help you without a better understanding of where you are in programming this, or what specific problem you may have. Assuming you havent written code for this yet, Id suggest you start with [Input][1] and [Animation][2] [1]: http://docs.unity3d.com/Documentation/ScriptReference/Input.html [2]: http://docs.unity3d.com/Documentation/ScriptReference/Animation.html
– roojerry