Hello World.
I’m having trouble creating a simple JavaScript that would destroy only the object with a certain name on collision with an object with a trigger. I have already created a script that should be able to do this, but it doesn’t work. The console has no issues with my script, yet it doesn’t work. So this is where you come in! Now I figure that if you help me fix my script you will be helping countless others in this subject since this would be useful to others like you, like me. Here is the script noted I’m sorta a noob at programming.
function OnTriggerEnter (other : Collider) { if(other.gameObject.name == "It"){ Destroy(other.gameObject); } }
Please Help.
Sincerely, Steven