You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the docs, it is stated that having a physics object as a parent causes transforms to be updated in such a way that the parent and child move independently of one another, so I was very confused when adding a non-physics entity (with or without Transform) as parent causes transform of the child not being updated even though the object was moving in the world (Position and Rotation were being updated) which left a ghost sprite with the physics object somewhere else in the world.
Here is the minimal reproduction:
let mesh = meshes.add(Rectangle::new(150.0,200.0));let material = materials.add(Color::srgb(0.3,0.3,0.7));
commands.spawn_empty().with_children(|parent| {
parent.spawn((RigidBody::Dynamic,Collider::rectangle(150.0,200.0),MaterialMesh2dBundle{mesh: mesh.into(),
material,transform:Transform::default(),
..default()},));});
Looking in the code, the query of update transform system from the sync plugin seems to match this entity but does not update the transform anyway.
FYI: I need this parent relationship to represent the ownership of player (physics entity) by a controller, so I don't want the parent (the controller) to be a physics object.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the docs, it is stated that having a physics object as a parent causes transforms to be updated in such a way that the parent and child move independently of one another, so I was very confused when adding a non-physics entity (with or without Transform) as parent causes transform of the child not being updated even though the object was moving in the world (Position and Rotation were being updated) which left a ghost sprite with the physics object somewhere else in the world.
Here is the minimal reproduction:
Looking in the code, the query of update transform system from the sync plugin seems to match this entity but does not update the transform anyway.
FYI: I need this parent relationship to represent the ownership of player (physics entity) by a controller, so I don't want the parent (the controller) to be a physics object.
Beta Was this translation helpful? Give feedback.
All reactions