Search Unity

Hidden states AnimatorController that can't be deleted

Discussion in 'Animation' started by ICEYHOTSTUNTA, Jul 13, 2019.

  1. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    Many of the AnimatorControllers in my project have hidden animator states that don't show up in the tree, can't be found by script and can't be deleted.

    This is really bad because they are referencing animations and assets that this character doesn't use.

    The only solution seems to be to rebuild the entire tree from scratch, or to try to hand edit the .controller files to remove them.

    I deleted all of the nodes out of the tree and this is what one of the offending nodes looks like in the .controller:

    AnimatorState:
    serializedVersion: 5
    m_ObjectHideFlags: 3
    m_CorrespondingSourceObject: {fileID: 0}
    m_PrefabInstance: {fileID: 0}
    m_PrefabAsset: {fileID: 0}
    m_Name: VehicleDropIn
    m_Speed: 1
    m_CycleOffset: 0
    m_Transitions:
    - {fileID: 1101000010208436596}
    m_StateMachineBehaviours:
    - {fileID: 114000011833258706}
    m_Position: {x: 50, y: 50, z: 0}
    m_IKOnFeet: 0
    m_WriteDefaultValues: 1
    m_Mirror: 0
    m_SpeedParameterActive: 0
    m_MirrorParameterActive: 0
    m_CycleOffsetParameterActive: 0
    m_TimeParameterActive: 0
    m_Motion: {fileID: 7400002, guid: 06a2f17f7e2c56844a99e3d6879d9249, type: 3}
    m_Tag:
    m_SpeedParameter:
    m_MirrorParameter:
    m_CycleOffsetParameter:
    m_TimeParameter:
    --- !u!1102 &1102789273184638972

    I noticed it has a different m_ObjectHideFlags from the other nodes, maybe that's part of the reason I can't see it or find it in script?

    I believe these offending nodes were created by copying an existing characters tree and then modifying it to create a new one.

    Is this a known bug? Any sneaky tricks to find the nodes through code?
     
  2. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    Update: It wasn't the hidden node causing problem, it's hidden transitions. It had two transitions that we're pointing and different trees somehow. Was able to remove the phantom transitions be hand editing the .controller... but this isn't really a production solution.

    How is it even possible for a transition to reference a completely different tree?
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Blend trees inherit from the same base class as AnimationClips, so the way Unity references them doesn't know or care whether they are actually inside the same Animator Controller.

    As for how that could actually happen, the only way I can think of would be if an editor script tried to copy a transition from one controller to another or something.