As of Bevy 0.12, EventReader buffers are no longer cleared between frames, causing the accumulation of non-consumed events.
In the case of systems that ignore events conditionally (like if a button is not pressed down), then unless you clear the buffer, all of those events will be replayed the next time the user presses the button, causing erratic behaviour.
For bevy_editor_pls, the consequence of not clearing the buffers is that if you move the mouse in between different pans/orbits/scrolling, the camera jerks erratically as soon as you press the button. The further it moved when the button wasn't pressed, the worse the effect.
I fixed this by clearing the buffers at any time that a system would return prior to the buffer being read. I audited non-mouse EventReaders as well; in those cases the consequences were likely just wasted memory, but I figured that I ought to fix all of them at once.
As of Bevy 0.12, EventReader buffers are no longer cleared between frames, causing the accumulation of non-consumed events.
In the case of systems that ignore events conditionally (like if a button is not pressed down), then unless you clear the buffer, all of those events will be replayed the next time the user presses the button, causing erratic behaviour.
For bevy_editor_pls, the consequence of not clearing the buffers is that if you move the mouse in between different pans/orbits/scrolling, the camera jerks erratically as soon as you press the button. The further it moved when the button wasn't pressed, the worse the effect.
I fixed this by clearing the buffers at any time that a system would return prior to the buffer being read. I audited non-mouse EventReaders as well; in those cases the consequences were likely just wasted memory, but I figured that I ought to fix all of them at once.
See also: https://github.com/bevyengine/bevy/issues/10860