Enemies: Astroid Explosion! | Unity 2D


Objective: Create an explosion sprite sequence when we shoot our Astroid.

First, create a game object for your explosion. Then create a new animation file and add the sprite sequence.

Back in the Astroid script, we need to make sure that when we collide with the player laser we instantiate the explosion prefab.
To do this, create a private Game Object called explosionPrefab and serialize the field.

Then in the update method we will insatiate our explosion prefab here.

Here is the result!



Chelsea Cruise

Unity Developer, Software Engineer, Game Designer, Graphic Artist