rapier icon indicating copy to clipboard operation
rapier copied to clipboard

Objects retain all velocity while moving through a Sensor

Open HyperCodec opened this issue 1 year ago • 4 comments

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.

HyperCodec avatar Mar 24 '24 19:03 HyperCodec

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?

sebcrozet avatar Mar 30 '24 11:03 sebcrozet

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

HyperCodec avatar Mar 30 '24 13:03 HyperCodec

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.

sebcrozet avatar Mar 30 '24 13:03 sebcrozet

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

HyperCodec avatar Mar 30 '24 15:03 HyperCodec