- Home /
How to play a destroy animation? Brick Breaker/Arkanoid.
I seem to have a fundamental misunderstanding of how animation works. Specifically, differentiating between the animation and animator.
Currently, my animations play automatically on play.
Do I need a separate Destroy Script or can I do this in the BrickScript? How many states do I need to transition between? I have 2 (broken/breaking)sprites + the initial brick sprite.
I understand I will likely need these parts:
public Animator anim;
anim = GetComponent
anim.SetBool("destroyBrick", true);
anim.Play("destroyBrick)";
and then call a gameobject destroy function?
Animator is basically mechanim, the new animation system. Animation is the legacy system.
You have multiple ways of achieving what you want. You can use the animator, create a brick animation (sprite still) and the break animation (2 frames). Create one transition to the break based on a trigger. Add an animation event to the last frame of it where you call the destroy.
Or you make the explosion a particle system you spawn in place of the brick on destroy. Or you manually trigger the clip by code, converting the break clip to legacy animation by toggling debug mode in the inspector.
Answer by bolkay · Sep 14, 2017 at 01:57 PM
Uncheck play automatically in the inspector under the Animation panel.
Your answer
Follow this Question
Related Questions
Dynamically add AnimationState to Controller 0 Answers
Animations will play for a second perfectly then stop HELP 1 Answer
Pause Menu issue with mouse 1 Answer
Animation Control 0 Answers