I tried to bevy_rapier 0.10 into my game project. But i was met with some issues namely this panic that occurs when you add a ColliderBundle to an entity that has a parent (in the Bevy sense).
Example code that exhibits the crash, adapted from one of your examples:
use bevy::prelude::*;
use bevy_rapier3d::prelude::*;
use rapier3d::pipeline::PhysicsPipeline;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_plugin(bevy_winit::WinitPlugin::default())
.add_plugin(bevy_wgpu::WgpuPlugin::default())
.add_plugin(RapierPhysicsPlugin::<NoUserData>::default())
.add_startup_system(setup_physics.system())
.run();
}
pub fn setup_physics(mut commands: Commands) {
let parent = commands
.spawn_bundle((Transform::identity(), GlobalTransform::identity()))
.id();
let collider = ColliderBundle {
shape: ColliderShape::cuboid(4.0, 1.2, 1.2),
..ColliderBundle::default()
};
commands
.spawn_bundle(collider)
// This next line is the offending code, uncomment and it works
.insert(Parent(parent))
.insert(ColliderDebugRender::default())
.insert(ColliderPositionSync::Discrete);
}
I tried to bevy_rapier 0.10 into my game project. But i was met with some issues namely this panic that occurs when you add a ColliderBundle to an entity that has a parent (in the Bevy sense).
Example code that exhibits the crash, adapted from one of your examples: