Skip to content

Can't get CollisionGroups working with KinematicCharacterController #480

Closed Answered by mrtelecaster
mrtelecaster asked this question in Q&A
Discussion options

You must be logged in to vote

Solved my own problem after discovering the filter_groups field on KinematicCharacterController. In order to get collisions filtering the way I expect, I needed to set the filter_groups field AND insert a CollisionGroups component using the same values. If I set filter_groups without the component, not only would it collide with everything but other fields such as apply_impulse_to_dynamic_bodies would stop working and no longer apply.

let filter = CollisionGroups::new(
	Group::from_bits(0).unwrap(),
	Group::from_bits(0).unwrap(),
);
commands.spawn((
	TransformBundle::default(),
	Collider::capsule(
		Vec3::new(0.0, -CHARACTER_END_HEIGHT, 0.0),
		Vec3::new(0.0, CHARACTER_END_HEIGHT, 0.0),
		C…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrtelecaster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant