- Home /
Ignore Colliders of an Object
I am trying to make my player ignore a ragdoll. I have tagged all colliders in the ragdoll with "RagDoll" and the array does find them, but the actual ignoring is not quiet working....does anybody know what the problem is?
public GameObject [] ignoringObjects;
public string Tag = "RagDoll";
// Update is called once per frame
void Update ()
{
ignoringObjects = GameObject.FindGameObjectsWithTag(Tag);
Debug.Log ("Updated RagDolls");
foreach(GameObject io in ignoringObjects)
{
Physics.IgnoreCollision(io.transform.collider, transform.collider);
Debug.Log("Updated Ignore collision with RagDolls");
}
}
If someone could help me with this matter, it would be much appreciated!
Thank you in advance.
Comment
Best Answer
Answer by whydoidoit · Feb 15, 2014 at 01:36 PM
You could put your RagDoll on a different layer and ignore collisions between the player and that layer using the physics layer interactions view in the editor? Would that help?
Awesome! How could I not know about this feature before? Thank you very much!