I want to make enemies enemy encounter objects Player, when the enemy to enemy collision objects Player three times, the object is converted to an object thing Player
Will the program how to write?
**var thing ;
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name == "enemy"){
Destroy(gameObject);
Instantiate(thing,transform.position,transform.rotation);
} else if(theCollision.gameObject.name == "PC"){
Debug.Log("Nothing");
}
}**