summaryrefslogtreecommitdiff
path: root/godot/scripts/cameras/plane_armcam.gd
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2022-09-07 14:07:30 -0400
committerAnson Bridges <bridges.anson@gmail.com>2022-09-07 14:07:30 -0400
commitc232b92e2dde1277324d1f89d0e75ae641e4ac3b (patch)
treee11a5dd52f259c1cc7345baa40b372b304417f00 /godot/scripts/cameras/plane_armcam.gd
parenta0967ebe815cd229b69fb9578f2288b95b2ddb28 (diff)
reorganized, ladders, vehicle control
Diffstat (limited to 'godot/scripts/cameras/plane_armcam.gd')
-rw-r--r--godot/scripts/cameras/plane_armcam.gd26
1 files changed, 26 insertions, 0 deletions
diff --git a/godot/scripts/cameras/plane_armcam.gd b/godot/scripts/cameras/plane_armcam.gd
new file mode 100644
index 0000000..edb0284
--- /dev/null
+++ b/godot/scripts/cameras/plane_armcam.gd
@@ -0,0 +1,26 @@
+extends SpringArm
+
+
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
+ $ClippedCamera.add_exception(get_parent())
+ add_excluded_object(get_parent().get_rid())
+
+
+#func _process(delta):
+
+
+func _input(event):
+ if $ClippedCamera.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 Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
+ if event is InputEventMouseMotion:
+ rotation_degrees.x = clamp(rotation_degrees.x-event.relative.y*0.1,-70,70)
+ rotation_degrees.y -= event.relative.x*0.1