It is a noob question, but Im starting dealing with programming, c# to be clear. So our teacher gave us this code:
var asteroid = collision.GetComponent\<AsteroidController\>();
if (asteroid != null)
{
Destroy(asteroid.gameObject);
}
We are developing a game, so I have 4 scripts, Asteroid Controller, PlayerController and Bullet Controller
In Bullet Controller I have the code for player destroy the gameobject that has the script Asteroid Controller.
My question is, in wich script do I need to put thiis line of code.
I put the code in asteroidcontroller but is doing some errors