Hello, I'm trying to create a camera for a little editor (A camera that you can move using the mouse wheel), It moves using the position of the mouse when is pressed the middle button of the mouse, but when I try to move it it goes back to it's initial position.
This is the code:
public override void _UnhandledInput(InputEvent @event)
{
if (@event is InputEventMouseMotion mouseMotion)
{
if (Input.IsActionPressed("middle"))
{
double delta = GetProcessDeltaTime();
GlobalPosition = -GlobalPosition.Lerp(GetGlobalMousePosition(), 2 * (float)delta);
}
}
}
Here is a video of the problem:
https://youtu.be/5lcMsAyjJrw