hi im going through the space shooter tutorial and its really challenging because things have changed , i need my laser to destroy the asteroid and the asteroid to explode aswell
heres what i have currently but its not working
void onTriggerEnter(Collider other)
{
if (other.tag == "Boundary")
{
return;
}
Destroy(other.gameObject,0.0f);
Destroy(gameObject);
}
if you want to quickly check the video its(the 9th video)
https://www.youtube.com/watch?v=OtPSvgr_ywY
I recommend ALWAYS going to the reference Unity scripting website and copy/pasting the capitalization for these functions, things like OnTriggerEnter, etc… it’s WAY too easy to get it wrong. I always do this copy/paste the first time I use a function name, just to make sure the camel-case capitalization is correct.
Or if you happen to be using Script Inspector 3 as your code editor (which I highly recommend), just start typing the name of the magic method (without “void” or “protected” or any such modifiers), and Si3 will see what you’re doing and suggest any matching method names. Then you just hit Return, and it fills in the full signature, with a comment about when/how to use it and, of course, the correct capitalization.