#QueryFilter based on components
10 messages · Page 1 of 1 (latest)
Based on my limited knowledge, this definitely sounds like a job for collision groups. That's exactly what they're designed for, and since they are a rapier feature, they'll be the most performant (I assume)
@normal thistle Alright thanks!
@normal thistle One thing that wasn't clear to me is: by default, are any of the collision groups in use? Like is everything Group1 by default?
From the docs, by default colliders are a member of every group.
https://rapier.rs/docs/user_guides/bevy_plugin/colliders#collision-groups-and-solver-groups
Colliders represent the geometric shapes that generate contacts and collision events when they touch.
oh? so if I want my ray-cast to only interact with one singular group, I have to make sure to always set the collider group manually for every single collider?
otherwise, every collider would be part of the particular group too
You'd do something like this:
- Determine the groups you want to use. You may have e.g. a 'world' group (like terrain), and 'enemy' group, etc.
- Put all your colliders into one or more of the groups from step 1 (i.e. override the default behaviour of belonging to every group0
- Set your ray's
filterto only the group that you want it to interact with