- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCameraController.gd
More file actions
Latest commit
18 lines (13 loc) · 600 Bytes
/
Copy pathCameraController.gd
File metadata and controls
18 lines (13 loc) · 600 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extendsNode3D
@exportvarsensitivity : int=5
# Called when the node enters the scene tree for the first time.
func_ready():
Input.mouse_mode=Input.MOUSE_MODE_CAPTURED
pass# Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func_process(delta):
global_position=get_tree().get_nodes_in_group("Character")[0].global_position
pass
func_input(event):
ifeventisInputEventMouseMotion:
rotation=Vector3(clamp(rotation.x-event.relative.y/1000*sensitivity,-1, .25), rotation.y-event.relative.x/1000*sensitivity, 0)