-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
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.