Attention | Topic was automatically imported from the old Question2Answer platform. | |
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.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
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.
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_velocity
to 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!