Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Parent Constraint losing sources when animating via timeline and turning into prefab

Discussion in 'Animation' started by LeFx_Tom, May 12, 2022.

  1. LeFx_Tom


    Jan 18, 2013
    We have seemed to encountered a bug when combining parent constraints with timeline animations.

    To reproduce:

    Create and animate an object (like a robot arm for example)
    Create an object, it should carry and add a Parent constraint to it.
    Add all necessary sources to the constraint (so for example starting table, robot-arm, end-position-table)
    Create a timeline
    Create an animation track and animate the the constraint weights, so the object gets parented/attached and detached at the right moments in time.

    Press play/play timeline to validate it works
    OPTIONAL: Turn recorded clip to clip asset (doesn't matter - just for the sake of trying it)

    Turn whole thing into a prefab

    Close Unity/open new scene
    Drag Prefab into scene

    Check: Sources in constraint are still there, list is full
    Press play/play timeline --> BUG: Sources are suddenly empy, but the weights still animate correctly.


    I believe this is a bug and it is a hell of an annoying one, because it prevents the use of these two components on prefabs as is.

    I found a workaround:

    Convert the animation clip to a clip-asset, open it to for edit in the animation window, delete every animated property, that is not a keyframed weight-change. It will still work, because the sources are still correctly set within the constraint, it will work as intended. The "record" function simply records things it cannot use later and breaks things by that.