aevyrie / bevy_mod_picking

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

Pick Hidden Components #275

Closed dgriffith0 closed 4 months ago

dgriffith0 commented 1 year ago

I have a use case where I want to click an object that isn't rendered to the screen. For example imagine a greedily meshed cube that was originally a 2x2 set of cubes. I would like to retrieve the entities of the individual hidden cubes and not the rendered mesh.

aevyrie commented 11 months ago

In that case you need to set up a backend for this. You could most easily do this by modifying the mod_raycast or rapier backends; it's probably only a few lines.

If we want to support this OOTB in this plugin, we would need to add this feature to relevant backends, to allow them to hit test against hidden objects, and a way to configure this. I'm not exactly sure what that would look like.

dgriffith0 commented 11 months ago

Thanks for the suggestion. Was able to get it working by modifying raycast back end.