Unity: Fixing explosion bug with enemy

Jake Boere
Jun 14, 2021

Objective: We need to fix a bug that causes the laser to still shot the enemy while the explosion animation is still running.

To start, we need to go into our enemy script and destroy the collider since that’s what is letting the game know that the enemy is still being hit.

To destroy the enemy collider we need to use the destroy function and get the collider component since the enemy is being spawned in as a child object of the enemy container.

--

--

Jake Boere

I am hard working Game development student learning as much about game development and unity as possible.