- Home /
Layers are colliding even though they are set to ignore each other
I have two objects that are on separate layers. Each one has a collider and a non-kinematic rigidbody. In Physics settings, I set the two layers to only collide with their own layer. However, the two objects are colliding, I know this because I'm printing the name of the Collision.collider in one of the object's OnCollisionEnter method (and I can see it happening). I have it also printing Physics.GetIgnoreLayerCollision between the two layers in OnCollisionEnter and it is true at the time of collision. The two colliders also don't even seem to be touching at the time of collision.
What could be causing this?
Answer by lightfoot218 · Dec 05, 2012 at 06:48 AM
Fixed it myself: One of the objects had a child with a collider that was on the other object's layer and was colliding with the other object. I was unintentionally creating a compound collider.