[Unity] Record a pit... About the code calling Animation animation not found

Go straight:

Obviously the animation component of gameobject has animation a, which is called with animation.play("a"), and an error is reported when using:

xxx animation clip not found。

problem causes:

When animation.play() is used, the attribute of animation a must be the old version animation, and the attribute is set to legacy.

solve:

Select animation file a and check Legacy in the inspector panel on the right:

If your version of unity does not see this option here, then click on the three dots in the upper right corner of the inspector panel, and then select debug, and there it is.

 

at last:

If set like this, the animation file cannot be dragged in the timeline. The two conflict with each other. Maybe it is a compatibility issue between the old and new versions (animation is older, timeline is newer)? I don’t know, it’s purely my immature guess. 

Guess you like

Origin blog.csdn.net/qq302756113/article/details/120003854