Search Unity

How to change wrapmode of animator?

Discussion in 'Animation' started by Jeste, Apr 27, 2016.

  1. Jeste

    Jeste

    Joined:
    Mar 30, 2016
    Posts:
    7
    I tried this but, unlucky.


    mAnimator.GetCurrentAnimatorClipInfo (0)[0].clip.wrapMode = WrapMode.Once;

    I didn't find anywhere how to use GetCurrentAnimatorClipInfo, so i expecting layer to be "(0)", cause it is base layer and "[0]", because it is current ClipInfo of animation. Also don't know why this function return array, when it say current clip info?

    I want once to play current animation from animator, when is fired event. And then return on "casual" animation to run it with WrapMode.Loop

    EDIT:
    also tried this:


    mAnimator.runtimeAnimatorController.animationClips [0].wrapMode = WrapMode.Once;
     
    Last edited: Apr 28, 2016