-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Labels
A-PickingPointing at and selecting objects of all sortsPointing at and selecting objects of all sortsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
Bevy version and features
- 0.17.3
--features custom_cursor
AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
What I did
In my game, I:
- had a custom cursor
- used sprite picking (i.e. click observers on sprites)
- had multiple cameras
Apparently, this deadly combo disables sprite picking, if the multiple cameras are spawned in certain order.
I made a demo to show it:
run with
ENABLE_CUSTOM_CURSOR_AT_STARTUP=1 SPAWN_MINIMAP_CAMERA_AT_STARTUP=1 cargo run --example custom_cursor_image --features custom_cursor
(from this revision of my fork: e55d756b7c70fffa331f1f6fb97f51ae03d2788a)
the commit after it is coding agent proposed fix where I investigated the issue
What went wrong
- if custom cursor is enabled and "minimap"(=second camera) is enabled, clicking on the sprite at the middle of the screen doesn't work until we disable the second camera ('C' key).
- if we respawn the second camera, sprite clicking is broken again
if either env vars in the command are missing, the example is working properly.
Additional information
coding agent proposed fix
guysv@5c36720
I see bevy 0.18 rc already has a different implementation there. maybe they avoid the bug?
WORKAROUND
to trick the find() call the fix removes, you can try to change the order you spawn cameras in your app. appears to make it work but it's undocumented so kinda scary.
Metadata
Metadata
Assignees
Labels
A-PickingPointing at and selecting objects of all sortsPointing at and selecting objects of all sortsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong