Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Animator.SetTime in Unity 5.6 beta (5.6.0b9)

Discussion in '5.6 Beta' started by cvasquez-coiron, Feb 28, 2017.

  1. cvasquez-coiron

    cvasquez-coiron

    Joined:
    Nov 10, 2014
    Posts:
    22
    Hello,

    Does anyone know what happened with Animator.SetTime() function that was available in Unity 5.5? (SetTime, Sets the Player's local time)

    Can't find that function in Unity 5.6.0b9, just need to set the starting position for playing Play() an animation.

    Thanks!
     
  2. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi.

    This was part of the Experimental DirectorPlayer API which has greatly changed in 5.6.

    What is your current usage of the Animator ? are you using it in a conjunction with an AnimatorController ( StateMachine ) or with the Playable API ?

    pp
     
  3. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    If you are using the Playables simply set the time of the playable with this :

    playableHandle.time = yourtime;

    otherwise if using an AnimatorController use

    animator.Play(STATENAME, -1, yournormalizedTime);

    hope this helps.

    cheers.
     
    Fab4 likes this.
  4. cvasquez-coiron

    cvasquez-coiron

    Joined:
    Nov 10, 2014
    Posts:
    22
    Hello Pierrepaul,
    Thanks for your response.
    animator.Play(STATENAME, -1, yournormalizedTime);
    Worked fine in Unity 5.6.0b11
    Thank you!