- Home /
how to detect collisions between objects if they're sleeping
I noticed that when a rigidbody falls to the floor, for example, it gets a handful of onCollisionEnter events, depending upon bounciness probably, followed by several onCollisionStay events. But once the rigidbody falls asleep, no more collision events happen, unless of course it is woken up. Kinda makes sense, but I think it should be called out in the docs.
I want to detect what objects are touching what other objects, but do so well after they've all fallen asleep. What's the recommended way to do this? Do I need to get fancy with raycasting? Do I need to record the LAST touching objects from onCollisionStay before the object falls asleep and remember it?
Answer by Eric5h5 · Jun 23, 2010 at 06:42 AM
Yes, you should record the last touching objects. Since the object is asleep, that information isn't going to change until something wakes it up.