Experimental VehicleBody3D setup for vehicle simulations

This commit is contained in:
reo 2025-03-11 00:48:33 +03:00
parent f6680e7028
commit 02d23d2199
11 changed files with 135 additions and 19 deletions

8
scripts/vehicle.gd Normal file
View file

@ -0,0 +1,8 @@
extends VehicleBody3D
@export var MAX_STEER = 0.5
@export var ENGINE_POWER = 300
func _physics_process(delta):
steering = move_toward(steering, Input.get_axis("turn_right", "turn_left") * MAX_STEER, delta * 10)
engine_force = Input.get_axis("move_backward", "move_forward") * ENGINE_POWER