[18500-need+to+get+help+.png|18500]
I believe what you have done is forgotten to use an if statement. You also forgot to close your Start function, which you really don’t need here at all. Here’s a revised version of your code. This should work:
var hp:float;
function Update()
{
if(hp <= 0)
{
Destroy(gameObject);
}
}
I think before you start scripting stuff you should learn how to code in Unity. No offense…
You have a javascript file. The syntax for pragma strict for javascript can be found here: What exactly is a JavaScript pragma? - Stack Overflow
Yeh but this is a school class project. And I dont have time to learn.