- Home /
How to collide two colliders if neither is using physics
I have two colliders at the moment, and I want them to collide and trigger, but I don't want either of them to be "physical" colliders. I want a object with a "is trigger" like box collider to run an event when it collides with another "is trigger" like box collider. I don't want to have to use "physical" colliders (such as rigidbody or a box collider with "is trigger" unchecked)to trigger my event. Is this possible?
The reason I am looking to do this is that I am building a RTS style game where a bunch of the unit have AIPathfinding and are controlled with character controllers. Putting colliders on them that effect physics breaks their ability to move. If I just have an "is trigger" collider on them it is fine though. I want them to trigger an event when they step into a certain area but because they can only use "is trigger" box colliders nothing gets triggered. Can anyone help me find a work around?
Have you looked into raycasting? http://docs.unity3d.com/Documentation/ScriptReference/Physics.Raycast.html
try rigidbody with is$$anonymous$$inesmatic checked, which tells Unity to ignore the Physics
Use OnTriggerEnter/Stay/Exit for trigger colliders. I guess I don't understand the problem that you're having. The area that they move into should have the trigger on it, not the unit. Then attach a script to the area that does something to whatever just walked into it depending on what it is.