init
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
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 )
|
||||
Reference in New Issue
Block a user