Hot to reproduce the problem:
-
create a cube or any other primitive (also an empty object works). Let’s say we call it MyObject
-
open the animation window and create a new clip. Let’s say we call it anim01
-
attach an Animation component to the object and make sure that the anim01 is selected and appears in the list.
-
create a C# script with the following start function
void Start () {
animation.Play();
}
This will give the following warning:
The AnimationClip ‘anim01’ used by the Animation component ‘MyObject’ must be marked as Legacy.
UnityEngine.Animation:Play(String)
MyScript:Start() (at Assets/Scripts/MyScript.cs:10)
…and the following error:
The animation state anim01could not be played because it couldn’t be found!
Please attach an animation clip with the name ‘anim01’ or call this function only for existing animations.
UnityEngine.Animation:Play(String)
MyScript:Start() (at Assets/Scripts/MyScript.cs:10)
I just need to make a simple cube move with an animation. This, if am not wrong, was the way to play an animation before Unity 4.3? Is something changed? Am I missing something?
Please help.
Thank you.
RS