How can I make a Cube with a Enemy tag on it to have a collider that can collide only certain objects.
Well heres the solution :
function Start () {
ignoreCollision("MyTag");
}
function ignoreCollision(tag : String) {
var objects = GameObject.FindGameObjectsWithTag(tag);
for (o in objects) {
if (o.GetComponent("Collider") && o != gameObject)
Physics.IgnoreCollision(collider, o.collider);
}
}
- Felipe