Skip to content

Mesh picking plugin's require_markers setting doesn't seem to work correctly #19182

Closed
@Runi-c

Description

@Runi-c

Bevy version

0.16

What you did

While trying to find a workaround for #19181 I tried enabling the require_markers: true setting in MeshPickingSettings, and added the MeshPickingCamera to my cameras and Pickable events to everything I wanted the mouse to interact with.

What went wrong

No picking events were fired at all.

Additional information

If I add a Pickable::default() component to the lowest entity in the hierarchy (not the lowest by depth from camera, nor the highest by depth from camera) then I start receiving picking events for everything in that hierarchy.

As in, in this hierarchy, only the red-dotted entities have Pickable, yet I receive picking events for all the other components, as demonstrated in the following logs:

Image

2025-05-12T06:23:55.849902Z  INFO spacetime::factory::shop: trigger.event().target: 157v1#4294967453 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.849993Z  INFO spacetime::factory::shop: trigger.target(): 113v1#4294967409 (Ok("Shop")
2025-05-12T06:23:55.850070Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.850141Z  INFO spacetime::factory::shop: trigger.event().target: 157v1#4294967453 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.850210Z  INFO spacetime::factory::shop: trigger.target(): 0v1#4294967296 (Err(QueryDoesNotMatch(0v1#4294967296, ArchetypeId(92)))
2025-05-12T06:23:55.851520Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.851614Z  INFO spacetime::factory::shop: trigger.event().target: 160v1#4294967456 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.851702Z  INFO spacetime::factory::shop: trigger.target(): 160v1#4294967456 (Ok("Pipe Bridge Inner")
2025-05-12T06:23:55.851781Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.851866Z  INFO spacetime::factory::shop: trigger.event().target: 160v1#4294967456 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.851958Z  INFO spacetime::factory::shop: trigger.target(): 159v1#4294967455 (Ok("Pipe Bridge")
2025-05-12T06:23:55.852031Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.852104Z  INFO spacetime::factory::shop: trigger.event().target: 160v1#4294967456 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.852183Z  INFO spacetime::factory::shop: trigger.target(): 158v1#4294967454 (Ok("Machine Port")
2025-05-12T06:23:55.852258Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.852321Z  INFO spacetime::factory::shop: trigger.event().target: 160v1#4294967456 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.852390Z  INFO spacetime::factory::shop: trigger.target(): 150v1#4294967446 (Ok("Pipe Switch")
2025-05-12T06:23:55.852509Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.852587Z  INFO spacetime::factory::shop: trigger.event().target: 160v1#4294967456 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.852695Z  INFO spacetime::factory::shop: trigger.target(): 113v1#4294967409 (Ok("Shop")
2025-05-12T06:23:55.852770Z  INFO spacetime::factory::shop: POINTER OUT EVENT
2025-05-12T06:23:55.852853Z  INFO spacetime::factory::shop: trigger.event().target: 160v1#4294967456 (Ok("Pipe Bridge Inner"))
2025-05-12T06:23:55.852933Z  INFO spacetime::factory::shop: trigger.target(): 0v1#4294967296 (Err(QueryDoesNotMatch(0v1#4294967296, ArchetypeId(92)))

If I simply remove the Pickable component from Pipe Bridge Inner then I no longer get any picking events even though all of these entities have Mesh2d.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PickingPointing at and selecting objects of all sortsC-BugAn unexpected or incorrect behaviorS-Needs-ReproductionNeeds an up-to-date or minimal reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions