- Home /
"Default clip could not be found in attached animations list" even though it is in the animations list
Scene setup:
http://i.imgur.com/TE8orGy.png
http://i.imgur.com/slooqT8.png
Code attached to collider script:
public GameObject weaponObject;
void OnMouseDown(){
Debug.Log(weaponObject);
weaponObject.animation.Play();
}
I honestly don't know where I am going wrong, every time I click it says "Default clip could not be found in attached animations list". If I change the code to animation.Play("swing"); it errors and says the animation could not be found. Please NOTE that the animation itself is applied to the child mesh (pCube1) inside the swordMain prefab.
Driving my crazy, I have tried everything I can think of. Another weird glitch is that the animation always plays once when I start the game, despite play automatically and loop being turned off.
Thanks in advance
Answer by qoobit · Dec 06, 2016 at 01:53 PM
Did you check to see if your animation was marked as legacy?
The animation component is a legacy tool, so you need to goto the top right of the Inspector and enter Debug Mode and set the animation to legacy.
Everything should work afterwards.
I hope that helps.
Your answer
Follow this Question
Related Questions
Animations one by one 0 Answers
Distribute terrain in zones 3 Answers
animation clip wont play 1 Answer
Play a second animation 2 Answers
Is it possible to add blendshape animation through script? 2 Answers