Yeah i keep getting this error using this code BCE0022: Cannot convert 'boolean' to 'UnityEngine.Collision'.
private var health = 100;
private var resetcolor = 30;
private var hit = false;
function Update () {
if (hit == true) {
resetcolor = resetcolor - 1;
renderer.material.color = Color.red;
hit = false;
}
if (resetcolor <= 0) {
renderer.material.color = Color.white;
}
if (health <= 0) {
Destroy(this);
Destroy(gameObject);
}
}
function OnCollisionEnter(hit : Collision) {
if (hit.gameObject.tag == "proj2") {
hit = true;
health = health - 50;
Destroy(hit.gameObject);
}
}