Hi!
I’ve been experimenting with using tags with collision detecting. All I want to do is have the object stop moving when it collides with the tag “Enemy”. I have no compiler errors, but nothing happens, the object just goes through the object with the tag. The object with the tag has a rigidbody, that is not effected by gravity.
OnCollisionEnter(theCollision : Collision)
{
if (theCollision.gameObject.FindWithTag("Enemy"))
{
transform.Translate(0,0,0);
}
}
here is the part of the script that handles the collision. This should be really simple, what am I doing wrong?
Thanks in advance
-Chris