aevyrie / bevy_mod_picking

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

Unable to get location for pointer Touch(0) #316

Closed favilo closed 2 months ago

favilo commented 6 months ago

I've been attempting to use the Pointer<Up> and Pointer<Down> events to handle touches on a mobile mancala game.

With the mouse, click events are working fine, but with touch input, I have to wait about 1 second for the Pointer<Up> event to be registered properly.

Here is the code I'm attempting to use.

I can see the Pointer<Down> pretty much every time, but if I let go too early, I get the following error:

Unable to get location for pointer Touch(0)

Clearly this is happening in pointer_events. But how can I ensure that the PointerLocation gets updated properly before the second is up?

aevyrie commented 6 months ago

but if I let go too early

My best guess is it's caused by bevy's lack of event ordering within a frame.

Cyannide commented 4 months ago

AFAIK, this is fixed by #319

aevyrie commented 2 months ago

Fixed by #319