Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider changing the default picking behavior of sprites to be non-pickable by default #16903

Open
coreh opened this issue Dec 19, 2024 · 1 comment · May be fixed by #17225
Open

Consider changing the default picking behavior of sprites to be non-pickable by default #16903

coreh opened this issue Dec 19, 2024 · 1 comment · May be fixed by #17225
Labels
A-Picking Pointing at and selecting objects of all sorts C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Milestone

Comments

@coreh
Copy link
Contributor

coreh commented Dec 19, 2024

From this discord conversation:

While I think having all UI nodes pickable by default is a very good choice, making all sprites pickable and blocking lower entities by default is not ideal, especially as sprites tend to be used for misc non-interactive things (like overlays, or nested cameras for rendering at lower resolutions) more often than not. You end up having to patch lots of spawning code adding PickingBehavior to suppress that behavior.

Also, some precedent from mesh picking, which has the RayCastPickable component.

(Also, if #16886 is merged, this should probably also apply to that.)

@alice-i-cecile alice-i-cecile added S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! D-Straightforward Simple bug fixes and API improvements, docs, test and examples A-Picking Pointing at and selecting objects of all sorts C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Dec 19, 2024
@Bytekeeper
Copy link

Bytekeeper commented Dec 26, 2024

I'm sorry if this is the wrong place, and I'm mostly addressing what you quoted from the discord conversation.
Having all UI nodes pickable by default has, in my opinion at least, some drawbacks:

  • Nodes used to layout only will block all things "below" it
  • Buttons are annoying since you need to litter all children with PickingBehavior::IGNORE or litter all children with observe...
  • It's counter-intuitive to have picking enabled for entities without any picking related component. For example, if you were to add another picking backend for an existing component, you would suddenly most likely break picking for many projects. (This is the classical additive vs subtractive argument, but since most of Bevy does use additive behavior, picking really stands out)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Picking Pointing at and selecting objects of all sorts C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants