Hi!
Learning Unity I made a little asteroid killing game. It starts with one asteroid and at some point, it instantiates a clone of it so there are two in screen.
I used this to check collision with asteroids:
function OnTriggerEnter(other : Collider)
{
//Check who we collided with
print(other.gameObject.name + " - " + other.gameObject.tag);
if(other.gameObject.tag == "astroid")
{
print("Hit!");
}
}
The problem is that it triggers with the original asteroid but it doesnt with its clones.
Also: Yes, the tag is "astroid".
↧