Skip to content

Any UI node blocks entities for picking with MeshPickingSettings.require_markers set to true #21697

@Temak1

Description

@Temak1

Bevy version and features

Version 0.17. Default features.

Relevant system information

System: Windows 10 x64

What you did

Added the MeshPickingPlugin to the app, inserted the MeshPickingSettings resource with require_markers set to true. Added the Pickable component to entities (I only have two types of pickable entities so far). None of the UI nodes have this component.

What went wrong

Expected the PointerInteraction to retrieve pickable entities under the cursor on each frame, but this does not happen.
If I disable the UI setup system, the MeshPickingPlugin works as intended.
It looks like any UI node (even those that serve as a transparent background for other nodes) will block picking without filling the PointerInteraction vector with any data.

Additional information

This problem is mentioned in #17023, but adding Pickable::IGNORE to all UI nodes seems to contradict the purpose of the require_markers setting when it's set to true.

I acknowledge that some UI nodes should block picking (but not all of them). When using bevy_mod_picking, I implemented a filtering function to exclude UI. Perhaps this could be mitigated by introducing a special component (like Pickable::BLOCK or similar) that could be added to specific UI nodes and buttons to intentionally block mesh picking behind them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PickingPointing at and selecting objects of all sortsA-UIGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions