Starting the Game after destroying the Asteroid.

Jason Schneider
Aug 11, 2021

At the moment we have:

in the Start method of our SpawnManager script. We need to create a new method in the script like:

public so other scripts can see it

In our Asteroid script we will need to add a variable:

Then in the Start method cache a reference to _spawnManager like:

Now we just need to add the following to the OnTriggerEnter method if (other.tag is “Laser”):

Saving the script and jumping back into Unity and running the game will give:

--

--