Added Ackerman Steering

This commit is contained in:
Wheelbarrow
2025-07-21 21:26:14 -04:00
parent 75ae5521fd
commit 896996dac6
5 changed files with 67 additions and 9 deletions

View File

@@ -2,12 +2,15 @@ class_name Wheel
extends RayCast3D
@export var wheel_radius: float = 0.316
@export var flipped: bool = false
@export_group("Suspension")
@export var suspension_rest_length: float = 0.1
@export var suspension_stiffness: float = 250_000
@export var suspension_stiffness: float = 30_000
@export var suspension_damping: float = 2000
func _ready() -> void:
target_position *= suspension_rest_length + wheel_radius
$"RX-Wheel".rotate_y(PI if flipped else 0.0)
func apply_forces(car: Car) -> void:
force_raycast_update()