I have an error in my Bullet Destroy script:
#pragma strict
function OnCollisionEnter(coll: Collision){
Destroy(gameObject);
}
function OnCollisionEnter(coll: Collision){
// do whatever you want to do, then destroy bullet:
Destroy(coll.gameObject);
}
NOT QUESTION:
(( There are multiple things wrong with my asking this question: I have started with C#, and this is in Javascript. It was one of my earlier scripts that I believe was based off of a tutorial. Also, I haven’t researched an answer yet, this is my first action. The only reason I’m really asking this question now is because I’m done for the night and won’t be able to get back on Unity for the majority of tomorrow, so I figured I would give this time. ))
QUESTION:
The error is that Unity expects a semicolon where it definitely doesn’t belong, which is on line 7, where only a } is. When I add this, a bunch of errors pop up because I’m sure it doesn’t belong. What’s wrong with my script that makes the Unity engine believe that?
Thanks