- Home /
Box collider with rigid body yet enemies still pass through each other.
Very basic problem and I really hope you can help me here...
I have two cubes both with the box collider set to trigger. The trigger works fine. When triggered the enemies start following the main player. Both cubes also have character controllers. This ensures the main player does not pass through the enemies when they collide. This works fine. Both cubes also have rigid bodies set to collsion detection discrete.
I expected the rigid bodies would ensure the enemies collide with each other but they don't. They just pass right through each other. Have been at this for hours and cannot get anywhere.
Any help (in c# preferably!) would be massivley appreciated.
Do the Enemies have Colliders attached to it (where trigger is NOT checked)? Only Colliders can well.... "collide" with each others. If your enemies only have their trigger colliders, they won't collide. Rigidbody & collisions only work with non-triggers
Resolved: Well, kind of. I was approaching it a stupid way. I was using collders as triggers, and yes, of course they won't 'collide' when set to trigger. So have used raycasts to act as triggers thus leaving the colliders as colliders. Thanks for your input Tseng.
Answer by mPal · Oct 23, 2011 at 12:02 PM
Resolved: Well, kind of. I was approaching it a stupid way. I was using collders as triggers, and yes, of course they won't 'collide' when set to trigger. So have used raycasts to act as triggers thus leaving the colliders as colliders. Thanks for your input Tseng.