so I'm trying to build a simple camera movement script that lets you drag the camera node with your mouse. The script below does work and you can move the camera very smoothly. However, if you hold down the mouse button and release it in quick succession (while moving the mouse), the camera does not move smoothly but rather jumps to the final position, as if a lot of "mouse movement" events aren't sent out.
If you simply hold down the mouse button and then move very fast, it's perfectly smooth, so there should be enough time for the system to call many "mouse movement" events.
Do you have an idea what's happening here? Because this is slightly annoying and very noticeable if you just quickly click and drag, and I would love to fix that :D
var is_dragging = false
if event is InputEventMouseButton:
starting_position = position
mouse_starting_position = event.position
is_dragging = true
is_dragging = false
if event is InputEventMouseMotion and is_dragging:
position = starting_position - zoom * (event.position - mouse_starting_position)