From 366761197034a20d444282431e4a8edeb7882840 Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Wed, 7 Sep 2022 14:16:17 -0400 Subject: whoops, fixed reorg --- scripts/cameras/player_firstperson.gd | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 scripts/cameras/player_firstperson.gd (limited to 'scripts/cameras/player_firstperson.gd') diff --git a/scripts/cameras/player_firstperson.gd b/scripts/cameras/player_firstperson.gd deleted file mode 100644 index ace49e6..0000000 --- a/scripts/cameras/player_firstperson.gd +++ /dev/null @@ -1,33 +0,0 @@ -extends Camera - - -var mouse_axis := Vector2() -var mouse_sensitivity = 12.0 - -func _ready(): - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) - current = false - - -func _input(event): - if current: - if Input.is_action_just_pressed("menu"): #toggle mouse capture on esc - if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE: - Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) - else: - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) - if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: - mouse_axis = event.relative - if mouse_axis.length() > 0: - var horizontal: float = -mouse_axis.x * (mouse_sensitivity / 100) - var vertical: float = -mouse_axis.y * (mouse_sensitivity / 100) - - mouse_axis = Vector2() - - get_parent().rotate_y(deg2rad(horizontal)) - rotate_x(deg2rad(vertical)) - - var temp_rot: Vector3 = rotation_degrees - temp_rot.x = clamp(temp_rot.x, -90, 90) - get_parent().animationcontroller.rpc("lean",-1*temp_rot.x/90) - rotation_degrees = temp_rot -- cgit v1.2.3