Camera movement by mouse

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JulioYagami

I’m trying to move the camera when the player clicks and drags the mouse but I don’t know how to make it.

:bust_in_silhouette: Reply From: RenenerG

Hello JulioYagami,

maybe a solution approach lies in the method get_last_mouse_speed() (see Input).

If you do the trick, you could for example add a Camera2D to a KinematicBody2D and calculate the linear_velocityto accelerate it, when you click the LMB.
Seems similar to a basic player-movement-controller.

Hope it helps you a bit to find a solution!