Search Unity

Simply play an animation with the animator via javascript...?

Discussion in 'Animation' started by Sollthar, Dec 9, 2018.

  1. Sollthar

    Sollthar

    Joined:
    Feb 11, 2010
    Posts:
    486
    Hi everyone

    I've never used the Animator component and always used legacy animations which I could play in Javascript with a simple:

    GetComponent.<Animation>().CrossFade("walk",0.4); (for example)

    Now since I'm using different mocap solutions, I went with the animator and use a humanoid model. How would I access and play a simple animation like "walk" by script in Javascript, similar to above? Just have it blend into a new animation by script.

    Watched some of the tutorials, but couldn't find anything... Help would be much appreciated.