2 extends CharacterBody3D
9 @export_category("Movement")
10 @export var speed = 5.0
12 @export_category("Camera")
13 @export var distance = 3.0
15 @onready var _springArm = $SpringArm3D
18 func _ready() -> void:
19 _springArm.spring_length = distance
20 playerReady.emit(self)
23 func _input(event: InputEvent) -> void:
24 if event.is_action_pressed("player_left"):
26 global_rotate(Vector3.UP, PI/2)
27 elif event.is_action_pressed("player_right"):
29 global_rotate(Vector3.UP, -PI/2)
32 func _physics_process(_delta: float) -> void:
33 velocity = global_transform.basis.z * speed