Search Unity

(fixed) Swapping RuntimeAnimatorController in runtime shows T-pose for 1 frame

Discussion in 'Animation' started by malkere, Jul 22, 2019.

  1. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,071
    I never used to have this problem. It seems since upgrading to 2018.3.9 every time that I swap my runtimeanimatorcontroller from the base to the override or vice versa the character renders in the T-pose for a frame on screen in-between the swap, almost as if there is a frame rendered with no runtimeanimatorcontroller.

    I have references to the base and override controllers and am swapping with:

    Code (CSharp):
    1.         if (bowEquipped) {
    2.             playerAnimator.runtimeAnimatorController = rangedController;
    3.         }
    4.         else {
    5.             playerAnimator.runtimeAnimatorController = baseController;
    6.         }
    Any ideas?

    Another thought is that I added multiplayer recently, and this is now being passed through a Command, RPC structure... maybe the timing of that is messing with the animator... I'll try playing with that idea... Nope, that didn't make a difference.
     
    Last edited: Jul 22, 2019
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    518
    There was a similar issue in Unity 2017 with the Playables API where an instantiated object would be in the default pose for a frame, but it was fixed in 2018.

    Give 2018.4 a go and if it still happens, submit a bug report.
     
  3. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,071
    I'm running a live project, updating Unity always opens a can of worms I try to avoid at all costs. Hopefully I can find something to try other than that, but will give it a shot if no other suggestions show up and players start mentioning it =3
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,223
    You could try to call Update, see if that does anything.
     
    malkere likes this.
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,071
    That seems to have fixed it! Great suggestion Baste. Thank you.
     
  6. prg-liulie

    prg-liulie

    Joined:
    Dec 23, 2017
    Posts:
    7
    I have the same problem, but Animator.Update can not help.