- Home /
animation play in game over
I want to play dead animation when game over. I create one cube,then I give one animation to cube. but appear
MissingComponentException: There is no 'Animation' attached to the "Cube" game object, but a script is trying to access it. You probably need to add a Animation to the game object "Cube". Or your script needs to check if the component is attached before using it.
NewBehaviourScript.Update () (at Assets\NewBehaviourScript.js:6)
What mean?
This my animation script.
var health0:Texture2D;
function Update(){ if(GeneralVars.blood <5)
this.guiTexture.texture = health0;
if (!animation.isPlaying)
animation.Play("dead");
}
My animation script cannot worked. How can I do?
Answer by Dreamora · Dec 17, 2010 at 08:40 AM
That means that you try to play an animation on application quit or scene switch or play something on a game object that you previous told to destroy or alike.
Generelly it means what the error tells you: You try to do something here on an object thats no longer present at all (like accessing animation if the animation component isn't present anymore on the game object at all at that point in time)
Your answer
Follow this Question
Related Questions
How to add Struggling Animation 0 Answers
Water Flowing in pipes 0 Answers
Play animation when 2 keys pressed? 3 Answers
Character won't play animation 8 Answers
PayPal in Game Buy 2 Answers