diff --git a/player/camera_gimbal.gd b/player/camera_gimbal.gd index 2f9e815..1e8713b 100644 --- a/player/camera_gimbal.gd +++ b/player/camera_gimbal.gd @@ -21,14 +21,14 @@ 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 var y = 0 var x = 0 - + if Input.is_action_just_pressed("shift_lock"): if shift_lock == true: shift_lock = false @@ -40,11 +40,10 @@ func _process(delta): mouse_locked = true 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)