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

Setting applyRootMotion on an animator resets its state

Discussion in '2018.3 Beta' started by mdeletrain, Oct 9, 2018.

  1. mdeletrain

    mdeletrain

    Joined:
    Jun 8, 2011
    Posts:
    47
    Hi,

    I have a MonoBehaviour that controls an animator's through its parameters and which also changes the applyRootMotion field when needed (false by default for in-game where I fully control the location of my object, true when game ends when I decide to let the animation do the job for me).

    This was working fine in 2018.2.10f1 but no more in 2018.3.0b4.

    Is that an issue on my side, requiring me do to that another way (please drop a hint then :p ), or is this a bug in the beta version ?
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135
    Sounds like a bug. Could you please submit a bug report for this issue with a reproduction project and reply in here with the issue ID?
     
  3. nciofi

    nciofi

    Joined:
    Nov 3, 2014
    Posts:
    8
    I have that exactly same problem when using 2018.3.0b5 and dealing with applyRootMotion.
    I have a bunch of StateMachineBehaviours that set root motion true or false depending on animation needs.
    In 2018.2 it worked fine. In beta, any time I change the value of root motion, it resets the animator.
    It happens only when changing the value. Setting the value to same value, does nothing weird, as expected.
    It also happens if I click the apply root motion checkbox on animator.

    However, there's this from scripting api, Animator.applyRootMotion:
    "Changing the value of applyRootMotion at runtime will re-initialize the animator."

    I never noticed that last line, and considering it, seems not like a bug. But, again, in 2018.2 it was working in a better way, changing applyRootMotion did not reset animator.

    A bug or not ?
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135
  5. nciofi

    nciofi

    Joined:
    Nov 3, 2014
    Posts:
    8
    Thank you. =D
     
    LeonhardP likes this.
  6. mdeletrain

    mdeletrain

    Joined:
    Jun 8, 2011
    Posts:
    47
    Yes thank you, I was going to create a repro case today (didn't have the time until now), but it seems it is no more necessary...
     
    LeonhardP likes this.