small racing game im working on
Diffstat (limited to 'classes/ghost.gd')
-rw-r--r--classes/ghost.gd11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/ghost.gd b/classes/ghost.gd
new file mode 100644
index 0000000..bfb13af
--- /dev/null
+++ b/classes/ghost.gd
@@ -0,0 +1,11 @@
+extends Node3D
+class_name GhostCar
+
+@onready var right_wheel := $frontright as MeshInstance3D
+@onready var left_wheel := $frontleft as MeshInstance3D
+
+func update(_origin: Vector3, _rotation: Vector3, steering: float) -> void:
+ right_wheel.rotation.y = steering * .75
+ left_wheel.rotation.y = steering * .75
+ global_rotation = _rotation
+ global_position = _origin