You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just upgraded to 0.12.1 and I noticed that this code no longer works for panning the camera with a mouse drag:
fn pan_camera(mutev_motion:EventReader<MouseMotion>,input_mouse:Res<Input<MouseButton>>,){
...
if input_mouse.pressed(pan_button){for ev in ev_motion.read(){
pan += ev.delta;}}
Previously the ev_motion reader would only contain events from the last frame. Now it seems that there is a backlog of events stored and so clicking the mouse results in a large pan happening.
I believe previously bevy used to only store the delta for two frames but now it is unbounded? I didn't see anything in the release or migration notes about this but I am guessing it might be related to #7728 (@james7132 )?
The workaround for now is to just clean the events every frame. This will fix the symptoms for one system but doesn't fix the underlying change which has implications for memory usage etc.
if input_mouse.pressed(pan_button){for ev in ev_motion.read(){
pan += ev.delta;}}else{
ev_motion.clear();}
The text was updated successfully, but these errors were encountered:
I believe previously bevy used to only store the delta for two frames but now it is unbounded? I didn't see anything in the release or migration notes about this but I am guessing it might be related to #7728 (@james7132 )?
#7728 will only stop running the update if both internal stores are empty. I don't think this is the cause of this issue.
Bevy version
0.12.1
What you did
I just upgraded to 0.12.1 and I noticed that this code no longer works for panning the camera with a mouse drag:
Previously the
ev_motion
reader would only contain events from the last frame. Now it seems that there is a backlog of events stored and so clicking the mouse results in a large pan happening.I believe previously bevy used to only store the delta for two frames but now it is unbounded? I didn't see anything in the release or migration notes about this but I am guessing it might be related to #7728 (@james7132 )?
The workaround for now is to just clean the events every frame. This will fix the symptoms for one system but doesn't fix the underlying change which has implications for memory usage etc.
The text was updated successfully, but these errors were encountered: