Improved camera

This commit is contained in:
2024-02-12 16:58:17 +01:00
parent e7132a50f7
commit 43e0825aff
7 changed files with 59 additions and 7 deletions

View File

@ -1,6 +1,8 @@
extends Node3D
@export var sensitivity: float
@export var max_rotation_x: float = 25.0
@export var min_rotation_x: float = -80.0
var enabled: bool
@ -24,3 +26,5 @@ func _unhandled_input(event):
rotation.x += deg_to_rad(-event.relative.y * sensitivity)
rotation.y += deg_to_rad(-event.relative.x * sensitivity)
rotation.x = clampf(rotation.x, deg_to_rad(min_rotation_x), deg_to_rad(max_rotation_x))