13 lines
458 B
GDScript
13 lines
458 B
GDScript
extends SpringArm3D
|
|
|
|
@onready var player: CharacterBody3D = $"../.."
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _unhandled_input(event: InputEvent) -> void:
|
|
if player.third_person and event is InputEventMouseMotion :
|
|
player.rotation.y -= event.relative.x * 0.005
|
|
player.rotation.y = wrapf( player.rotation.y, 0.0, TAU )
|
|
|
|
rotation.x -= event.relative.y * 0.005
|
|
rotation.x = clamp( rotation.x, -PI/2, PI/4 )
|