Closed tadeohepperle closed 3 months ago
The Collider
contains some internal indices related to other parts of the physics engine. You have mutable access to che collider so you can call its mutable methods, but overwriting it completely will be problematic.
I will add a Collider::copy_from
function that you can use instead of direct assignation old_collider.copy_from(&new_collider)
. But, yes, it will be preferable to only set the shape if that’s what you need to achieve.
I have some code in which I need to update colliders every frame, because the size of my objects changes over time:
Running this gives me:
Why do I have mutable access to the collider if I am not allowed setting it? Should I instead just set the shape of the collider via
set_shape()
instead of replacing the entire collider? :)