]> Untitled Git - lightcycles.git/blob - player/player.gd
Initial project
[lightcycles.git] / player / player.gd
1 extends CharacterBody3D
2
3 @export_category("Movement")
4 @export var speed = 5.0
5
6 @export_category("Camera")
7 @export var distance = 3.0
8
9 @onready var _springArm = $SpringArm3D
10 @onready var _skin = %skin
11
12
13
14 func _input(event: InputEvent) -> void:
15         if event.is_action_pressed("player_left"):
16                 global_rotate(Vector3.UP, PI/2)
17         elif event.is_action_pressed("player_right"):
18                 global_rotate(Vector3.UP, -PI/2)
19
20 func _physics_process(delta: float) -> void:
21         velocity = global_transform.basis.z * speed
22         move_and_slide()