- Home /
Question by
curleyjohnson · May 18, 2016 at 04:29 AM ·
animationreset-positionpositions
When I play an animation in Unity 5 it plays fine, but when it's through it resets back to it's origin. How do I make it stop resetting and play the next animation from where the last one ended?
public class Attack : MonoBehaviour
{
void Update ()
{
if(Input.GetKeyDown("f"))
GetComponent<Animation>().Play("Skeleton|FistStrike");
if(Input.GetKeyDown("g"))
GetComponent<Animation>().Play("Skeleton|SnakeStrike");
if(Input.GetKeyDown("h"))
GetComponent<Animation>().Play("Skeleton|Fall");
if(Input.GetKeyDown("v"))
GetComponent<Animation>().Play("Skeleton|Jump");
if(Input.GetKeyDown("b"))
GetComponent<Animation>().Play("Skeleton|Run");
if(Input.GetKeyDown("n"))
GetComponent<Animation>().Play("Skeleton|Walk");
}
}
Comment