blob: 68b4852357283d0de0649821b6c2e56ae5738bbb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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.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
|