- Home /
Advice for Intersecting Colliders
Hello everyone, I'm looking for some advice / best practices on how to handle situations where meshes with colliders need to intersect.
My Situation: I've got a room that has pillars which, at a certain point, will start to fall over (controlled with rigid bodies and scripts). The ground has a collider (and is not always flat), so no matter what there will always be some intersection between the ground collider and the pillar colliders before they start to fall (which results in the pillars being "shot upwards" when the scene starts as the ground collider rejects the pillars).
I've considered layers, and just putting a flat collider under the ground to handle the pillars, and have considered animating the pillars (but I'd really rather not). If there is a better/more simple way of accomplishing this, I would love to hear about it.
The short version is: the player can be crushed by the pillars and as this happens, the room fills with water. - hope that helps.
What about using another collider? But this one will be slightly above the bottom of your pillar so that it doesn't collide with floor.
IgnoreLayerCollision() or simply IgnoreCollision() is definitely the way to go here. It's about as simple as something like that gets. If the pillar is queue'd to fall, then switch it to ignore the rough ground and collide with a flat collider.
Thank you both for the suggestions, I might end up mixing the two to try and get as close to a "real" behavior as possible.