bevy_rapier2d::plugin::systems

Function on_add_entity_with_parent

Source
pub fn on_add_entity_with_parent(
    q_add_entity_without_parent: Query<'_, '_, (Entity, &Parent), (With<RapierContextEntityLink>, Or<(Changed<RapierContextEntityLink>, Changed<Parent>)>)>,
    q_parent: Query<'_, '_, &Parent>,
    q_physics_world: Query<'_, '_, &RapierContextEntityLink>,
    commands: Commands<'_, '_>,
)
Expand description

If an entity is turned into the child of something with a physics context link, the child should become a part of that physics context

If this fails to happen, weirdness will ensue.