Search Unity

How to get GameObjects used in AnimationClip

Discussion in 'Animation' started by NaxiaLascif, Aug 26, 2019.

  1. NaxiaLascif

    NaxiaLascif

    Joined:
    Jun 10, 2013
    Posts:
    18
    How can I, via code, get all the GameObjects that an AnimationClip touches? The Animations in Unity are notoriously fragile and break super easy because they are based on name an hierarchy (instead of GUID), and I am trying to write tools to prevents them from breaking all the time when Artists are iterating on features.

    Is there a clean way to get an array of all the GameObjects in an AnimationClip? Similar to the way you can see the list of objects in the Animation window?