Ive created an Object that should act as a tower in a spacewars game, it attacks, looks at the target and aims properly and stuff, but it doesn't recieve damage for a reason, I've attached the following script on the object, whats really happening is, that the function OnCollisionEnter isnt even functioning, because the nothing is appearing on the Debug Log:
private int health=20;`void onCollisionEnter(Collision other)
{
if(other.gameObject.tag==“Bullet”)
{
health-=5;
Debug.Log(health.ToString(),gameObject);
}
}// Use this for initialization
void Start () {}
// Update is called once per frame
void Update () {
if(health<=0)
Destroy(gameObject);}
`
}
Thanks for help.