← All examples

godot components

Raycast suspension vehicle for arcade driving

Drive a RigidBody3D on raycast wheels: spring-damper suspension per wheel, drive force on driven wheels, steering on front wheels, lateral grip and rolling resistance, with a ride height independent of mass.

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • example.tscn
  • inspect_gdscript.py
  • raycast_vehicle_3d.gd
  • run_tests.gd
  • test_package.py
  • tests/test_raycast_vehicle_3d.gd
  • verification/native.json

How it works

Class
BaltorRaycastVehicle, extends RigidBody3D
Methods
suspension_force(compression: float, compression_speed: float, stiffness: float, damping: float, mass_share: float) -> float; lateral_force(side_speed: float, grip: float, mass_share: float) -> float; set_controls(throttle: float, steer: float) -> void; get_wheel_count() -> int; is_wheel_grounded(index: int) -> bool; get_wheel_compression(index: int) -> float; grounded_wheel_count() -> int;…
Signals
airborne_changed
Exports
wheel_points, steering_wheel_count, driven_wheels, rest_length, wheel_radius, spring_stiffness, spring_damping, engine_acceleration and 5 more
Placement
res://baltor/godot_components/raycast_vehicle_3d/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • godot_parse_check_only
  • godot_gdscript_tests
  • godot_tests_reject_gutted_component
  • godot_editor_import
  • godot_contract_reflection
  • godot_example_scene
  • godot_readme_usage_compiles

Limits to consider

Arcade model: no engine torque curve, gears, tire slip curves or differential; wheel meshes are not moved. Grip is linear in sideways speed. The chassis collision shape must sit above the wheel points. Tested on flat ground in headless Godot physics. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.