dimforge / rapier

2D and 3D physics engines focused on performance.
https://rapier.rs
Apache License 2.0
3.77k stars 235 forks source link

Objects retain all velocity while moving through a Sensor #610

Open HyperCodec opened 3 months ago

HyperCodec commented 3 months ago

I had a game where the player would move through a sensor area, but upon coming into contact with the sensor, they begin to slide at a constant rate and do not appear to be affected by any sort of velocity changes while within the sensor.

sebcrozet commented 3 months ago

Hi! This is lacking details on how to reproduce the problem. Is there any code you can share, or any steps to reproduce the issue ourselves?

HyperCodec commented 3 months ago

Hi! This is lacking details on how to reproduce the problem. Is there any code you can share, or any steps to reproduce the issue ourselves?

I used bevy-fps-controller (might be a bug from them) to control the player and then added a platform with a box collider and a sensor in a separate entity on top of it.

The platform was cxhull scene collider.

Also for all the bundles and stuff on the player check the example on bevy-fps-controller repo

sebcrozet commented 3 months ago

That does sound like a bevy-fps-controller issue. I assume your player is represented by a kinematic body, in which case the physics simulation itself doesn’t have any control over the forces/trajectory applied to the object. So it is up to the character controller to detect obstacles and adjust positions/velocities of the kinematic object.

HyperCodec commented 3 months ago

That does sound like a bevy-fps-controller issue. I assume your player is represented by a kinematic body, in which case the physics simulation itself doesn’t have any control over the forces/trajectory applied to the object. So it is up to the character controller to detect obstacles and adjust positions/velocities of the kinematic object.

Actually I believe I am using a dynamic rigidbody. There might still be some kinematic velocity changes though