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

Recursive ignore? #305

Closed devnev closed 6 months ago

devnev commented 7 months ago

I'm applying Pickable::IGNORE to a scene that I'm using as a hover hint/highlight,

    commands.spawn((
        HoverHighlight,
        SceneBundle {
            scene,
            ..default()
        },
        Pickable::IGNORE,
    ));

and as far as I can tell, the meshes in the scene are still blocking hits. Would it be possible to have a PickVisibility or similar that is hierarchical?

I think I've worked around it with an extra component that triggers a system that recursively applies the ignore, and re-applies it when the scene component changes.

aevyrie commented 6 months ago

There is nothing provided out of the box. The only provided hierarchical features are event listeners, provided by the eventlister crate. The reason this does not exist ootb is it would require arbitrary hierarchy traversal for every check. If you want to provide recursive behavior, you will need to apply the components yourself.