[SOLVED] Animation components not visible to inspector

Say you have the following class:

public class Foo : MonoBehaviour {
    public AudioSource mySource;
    public Animation myAnim;
}

When you put this component on an object and click the little circle in the mySource field, you’ll get a list of all the AudioSources in the scene (and a tab with AudioSources in the project as well, but that’s irrelevant).

However, when you click the little circle in the myAnim field, you’ll just get the empty [None] object in your scene, as if the editor can’t find any objects with the Animation component.

Strangely, you can still drop any other GameObject with an Animation component into the myAnim field and it registers no problem; objects without an Animation component cannot be dropped in.

Why can’t the editor show me a list of all Animation components in a scene?

Heyyy, so it seems like this has been fixed in Unity 5 – you can search for animation in Scene view, or you can select it from a selection field, without any problems (that I’ve seen).

Nifty.