-
When I spawn a CollisionShape as a child with the Reproduction: fn spawn(mut commands: Commands) {
let mut rigid_body_entity = commands.spawn();
commands.spawn()
.insert(RigidBody::Dynamic)
.insert(Transform::from_translation(Vec3::new(-400.0, 200.0, 0.0)))
.insert(GlobalTransform::default())
.with_children(|children| {
// A first physics shape
children.spawn_bundle((
CollisionShape::Cuboid {
half_extends: Vec3::new(15.0, 15.0, 0.0),
border_radius: None,
},
Transform::default(),
));
});
} The workaround is to add a There is a workaround, but it would be welcome for things to work out of the box. I know how to fix it, PR coming :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi. That's intended behavior, and in fact it is not only a problem of the debug renderer, the rigid-body should not work at all. If there is no It's even properly documented. Both, the
|
Beta Was this translation helpful? Give feedback.
Hi.
That's intended behavior, and in fact it is not only a problem of the debug renderer, the rigid-body should not work at all.
If there is no
GlobalTransform
, the body doesn't have a global position/rotation. It is nowhere.It's even properly documented. Both, the
README.md
and root crate documentation say: