Improved camera
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user