I seem to be having an issue getting the KinematicCharacterController filter groups to work correctly. My setup is that I have a player character modeled by a position-based controller and some projectiles modeled by a dynamic rigid body. I've place both in different groups, but they still show up in the collision detection system. I've also tried ignoring all dynamic bodies using KinematicCharacterController::filter_flags but that doesn't seem to work either. Any help or hints are appreciated.
pub fn player_contact_detection_system(
rapier_context: Res<RapierContext>,
query: Query<Entity, With<Player>>,
) {
let player = query.get_single();
if let Ok(player_entity) = player {
for contact_pair in rapier_context.contacts_with(player_entity) {
let player_collider = if contact_pair.collider1() == player_entity {
contact_pair.collider1()
} else {
contact_pair.collider2()
};
let other_collider: Entity = if contact_pair.collider1() == player_entity {
contact_pair.collider2()
} else {
contact_pair.collider1()
};
println!(
"player contact graph between player collider: {:?}, other collider: {:?}",
player_collider, other_collider
);
}
}
}
Output:
player contact graph between player collider: 1v0, other collider: 11v0
player contact graph between player collider: 1v0, other collider: 12v0
player contact graph between player collider: 1v0, other collider: 13v0
player contact graph between player collider: 1v0, other collider: 14v0
...
I seem to be having an issue getting the
KinematicCharacterController
filter groups to work correctly. My setup is that I have a player character modeled by a position-based controller and some projectiles modeled by a dynamic rigid body. I've place both in different groups, but they still show up in the collision detection system. I've also tried ignoring all dynamic bodies usingKinematicCharacterController::filter_flags
but that doesn't seem to work either. Any help or hints are appreciated.Cargo.toml
Player:
Projectiles:
Collision detection system:
Output: