- Home /
Can you have an OnTriggerX event with Sleeping rigidbodies?
I've noticed that if a Rigidbody falls asleep that it will not be able to experience OnTriggerX events with an IsTrigger collider.
In my project I instantiate an explosion Prefab as a box collider with IsTrigger set (no rigidbody), I want to detect the trigger event and handle it myself. The only problem is that the rigidbodies fall asleep. Is the best solution to really just apply a force of 0 to all rigidbodies near the explosion? That's what I've seen suggsted. Seems like there should just be a way for the trigger to occur with a sleeping rigidbody. Triggers are supposed to be different than collisions... But not really, the Unity model is a bit confusing here.
The two objects should be able to have trigger events and indeed they do have them if I wake the rigidbody up (By applying a force or walking my game character into it). http://docs.unity3d.com/Documentation/Components/class-SphereCollider.html
Answer by TonyLi · Sep 12, 2013 at 01:41 PM
Read the rules on Rigidbody Sleeping if you haven't yet. You could add a kinematic rigidbody to the explosion.
$$anonymous$$inematic rigidbody would still push other nonkinematic rigidbodies around wouldn't it? I don't really want that.
Your answer
Follow this Question
Related Questions
Change rigidbody transform without waking rigidbody? 0 Answers
Kinematic rigidbody only triggering once 0 Answers
Is it slow to move a rigidbody's child/compound collider? 1 Answer
Can't click gameobject when over another trigger? 1 Answer
Kinematic Rigidbody Collider not colliding with Static Trigger Collider 3 Answers