bevy_rapier
bevy_rapier copied to clipboard
Fix spawn position of colliders without rigid bodies
Attempt to fix #249.
Issue occurs when a collider has no parents and is not being attached to a rigid body. Since the entity has no parent it will not get it's own transform from the parent query. With these changes if a collider is not being attached to a handle we instead use the global transform to position it. Based on the documentation for ColliderBuilder.position and testing this seems correct.
Fixes the bug as it appears in #249 and as I encountered it in my personal project.