aevyrie / bevy_mod_picking

Picking and pointer events for Bevy.
https://crates.io/crates/bevy_mod_picking
Apache License 2.0
764 stars 170 forks source link

[XPBD] Cannot select Kinematic Bodies #332

Open sweglord227 opened 3 months ago

sweglord227 commented 3 months ago

Creating an entity with the RigidBody::Kinematic component, bevy_mod_picking does not react to it in any way. Debug display shows no information on it, On events are not registered, and PickSelection component does not react to any and all inputs. This is unexpected behavior which i believe is not documented anywhere.

ex spawn:

commands.spawn((
    PickableBundle::default(),
    TransformBundle {
        local: Transform::from_xyz(0.0, 0.0, -2.0),
        ..default()
    },
    RigidBody::Kinematic,
    Collider::cuboid(1.0, 1.0, 1.0),
    On::<Pointer<Over>>::target_component_mut::<Transform>(|mouse, transform| {
        transform.translation += *transform.forward();
    }),
    XpbdPickable,
))

when moused over this entity will not move, and debug will show no information on it if you comment out the On component.