Search Unity

Correct way to record animation of a "model parent"?

Discussion in 'Timeline' started by R1PFake, Nov 2, 2020.

  1. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    542
    I have a player model which has a weird rotation / scale after importing, that's why I made a empty dummy parent object offset the transform of the player model and moved the animator to the dummy parent object. (I do this all the time and I have seen many other people do the same, so I assume this is a normal workflow). This works fine for animations which are controlled by the animator (with code to control the animator).

    But for some reason I can't figure out how to record animations in a timeline with this setup, because when I hit record I try to move the parent object, but as soon as I move it, suddenly the child transform values are changed and not the parent object which I drag and it starts to jum p/ move the objects in a weird position / rotation etc just a total mess.

    I tried different track offset modes like "Applay Transform Offsets" or "Apply Scene Offsets" but it doesn't make a difference. I don't understand why the timline animation recorder changes the child transform when I drag the parent transform. Am I missing something obvious or what's going on?

    When I unparent the model and move it directly it works fine, but I would rather not unparent all my objects just to move them in timeline
     
  2. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    542
    Possible solution / workaround:
    - I moved the animator to the actual model intead of the dummy parent
    - I changed my player code to get the animator of the child object, so that the current code still works
    - I store the local model transform parent "offsets" before I start the timeline
    - In the timeline I now drag the actual model / animator instead of the parent
    - At the end off the timeline I adjust the positions of the parent / model child, so that the dummy parent transform is at the last position where the model child was moved during the timeline and reset the local transforms of the model

    Not sure if this is the "correct" way to do it, but it seems to work (so far)
     
  3. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    This sounds like a bug in the timeline keyframing, possibly due to the root of the animated hierarchy not being the same as the root transform. Would you be able to submit a bug with a repro case? I haven't seen this behavior before, so I can only speculate at the cause.
     
  4. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    542
    I tried again with the newest version and I can confirm that the problem only happens with animated models, when I parent a cube to an empty object it works fine, but if I try the same thing with an actual animated model it acts weird. I made a bug report with a simple project, Im not sure if I can post the ID here, because the email says I shouldn't share it in the forum.
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Thank you for taking the time to assemble the bug report.