system
1
i have tagged all the projectiles that do damage to my main char "enemy_projectiles" and wrote the script
function OnCollisionEnter(gameObject.tag=="enemy_projectile") {
HEALTH -= 10;
}
but i get an error BCE0043: Unexpected token: .. . it still lets my game run and the script works fine but i want the error to go away as it keeps comming back even though i click clear.
qJake
2
You obviously don't have a very strong understanding of programming, which is an essential skill required for making Unity games. I would suggest you take a look at this page:
http://answers.unity3d.com/questions/4897/how-can-i-start-learning-unity-fast-list-of-tutorials
which details how you can learn to script/program in Unity.
As for your "code"..., you've put a boolean condtion inside of a function header, which makes absolutely no sense. You want to do something like this:
function OnCollisionEnter(other : Collision)
{
if(gameObject.tag == "enemy_projectile")
{
HEALTH -= 10;
}
}