Home › Forums › General Questions › Disable physics body for collision detection
- This topic has 4 replies, 2 voices, and was last updated 1 month, 1 week ago by
Thomas Fabini.
-
AuthorPosts
-
2026-06-12 at 6:52 am #87502
Thomas Fabini
ParticipantHi Guys,
I tried excluding ghost physics bodies from collision detection (if touching) and failed so far.
Setting different states (enable / disable simulation, enable / disable contact response, activate / sleep) didn’t affect the detection of touching / not touching other physics bodies.Is this the expected behaviour?
Is there maybe another way to prevent physics body collision detection?Thanks,
Thomas-
This topic was modified 1 month, 2 weeks ago by
Thomas Fabini.
-
This topic was modified 1 month, 2 weeks ago by
Thomas Fabini.
2026-06-12 at 4:15 pm #87510
Alexander KovelenovStaff2026-06-15 at 7:55 am #87515Thomas Fabini
ParticipantHi Alexander,
Thank you for your reply. Yes, exactly that – I’m trying to exclude overlapping objects from detection.
I’m using mechanics which roughly resemble those in the Snowball VR demo for grabbing the weapons. Where Weapon._setup_collisions updates the colliding weapons list from which the first colliding object is picked on left / right hand grab.
As things get more complicated than that, I have overlapping collision objects where it is unclear which one gets returned first when the hand touches them. Each one has its own properties along with a bool enabled / disabled for this purpose, but I was looking for a way to avoid collision detection completely (from the physics engine) for any disabled object.
Thanks,
Thomas2026-06-15 at 5:08 pm #87517
Alexander KovelenovStaffHi,
I see. You might remove physics body from the inactive objects (keeping geometry) and add ghost body when it’s actually needed. Both operations should not take much time.2026-06-17 at 6:44 am #87529Thomas Fabini
ParticipantHi Alexander,
thank you for pointing that out. Then I will try this approach.
When removing the physics body, any physics properties which where applied are removed, too, I assume. With ghost bodies that usually would be just the margin in my setup.
Thanks,
Thomas -
This topic was modified 1 month, 2 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
