Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpatialQueryFilter excluded entities should check against ColliderParent #646

Open
dminikm opened this issue Feb 2, 2025 · 0 comments
Open

Comments

@dminikm
Copy link

dminikm commented Feb 2, 2025

I'm playing around with this library (and bevy in general) and hit an issue.

I'm attempting to create a character controller with a camera. I wanted the player collider to be offset a bit and couldn't find any other way than though making it a child of the parent.

"Player"
├ ... Some components
├ RigidBody
└ Children
  └ "Player Colliders"
    └ Collider

However, when running a shape casting query for the camera, the player exclusion is ignored, as the entity that gets reported as hit is the "Player Colliders" entity.

  let query_result = spatial_query.cast_shape(
      &Collider::sphere(0.3),
      player_transform.translation,
      Quat::default(),
      Dir3::new(-rotated).unwrap(),
      &ShapeCastConfig {
          ..default()
      },
      &SpatialQueryFilter::from_excluded_entities([player_entity]),
  );

I'll probably solve this for now by just creating the colliders on the Player without the offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant