bevy_rapier icon indicating copy to clipboard operation
bevy_rapier copied to clipboard

Updating a `Collider` through one of the `**_mut()` method doesn't work

Open nicopap opened this issue 1 year ago • 3 comments

When I update a Collider component, using one of the **_mut() methods such as as_cone_mut(), I find that the collider is never updated. Instead, I have to clone the SharedShape of the Collider using the Shape::clone_box method and replace the raw field of Collider.

It probably happens because somewhere, update is dependent on Arc pointer comparison instead of structural comparison. A good way of working around that is to make the set methods of the various **ViewMut set a "update" field in Collider, and use that field in addition to the pointer comparison for update detection.

nicopap avatar Aug 24 '22 06:08 nicopap

I have found the same issue and have tracked it down to (at least in my case) having a RapierPhysicsPlugin::physics_scale of something other than 1.. reproduction here https://github.com/MalachiMackie/bevy-rapier-resize-collider-physics-scale-repro

MalachiMackie avatar Nov 07 '22 08:11 MalachiMackie

I'm running into this issue right now and I can't figure out a way around it.

Also of note, I haven't changed the physics scale of bevy and this still happens to me :/

cole21771 avatar Dec 29 '22 03:12 cole21771

@cole21771 check the PR linked in this thread (https://github.com/jakobhellermann/bevy-inspector-egui/pull/83) it works around the isssue

nicopap avatar Dec 29 '22 08:12 nicopap