diff --git a/player/camera_gimbal.gd b/player/camera_gimbal.gd index 1d4ca4a..b27f338 100644 --- a/player/camera_gimbal.gd +++ b/player/camera_gimbal.gd @@ -21,8 +21,8 @@ func rotate_camera_x(x, delta): func _input(event): if event is InputEventMouseMotion: - mouse_x_velocity = event.velocity.x - mouse_y_velocity = event.velocity.y + mouse_x_velocity = event.relative.x + mouse_y_velocity = event.relative.y func _process(delta): # rotate outer gimbal around y axis @@ -40,10 +40,10 @@ func _process(delta): locked_mouse_positon = get_viewport().get_mouse_position() Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) - if mouse_x_velocity > 200 or mouse_x_velocity < -200: - y -= clamp(mouse_x_velocity / 500, -5, 5) - if mouse_y_velocity > 200 or mouse_y_velocity < -200: - x -= clamp(mouse_y_velocity / 1000, -5, 5) + if mouse_x_velocity > 5 or mouse_x_velocity < -5: + y -= clamp(mouse_x_velocity / 12.5, -10, 10) + if mouse_y_velocity > 5 or mouse_y_velocity < -5: + x -= clamp(mouse_y_velocity / 12.5, -10, 10) else: Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) mouse_locked = false