Godot Version
v4.6.3
Question
I’ve been trying to get a VehicleBody3D to function properly, but I’ve come to a full stop with a bug that I haven’t been able to get around. When I spawn my vehicle, it shows that the wheels are touching the ground visibly, but my debug says that they are not colliding with the ground, meaning they are not able to produce power/traction. I’m using a very simple script for my vehicle for now until I can figure out this issue.
This probably sounds pretty vague, but I will gladly give anyone info if it would help.
extends VehicleBody3D
@onready var wheel_fl: VehicleWheel3D = $WheelFL
@onready var wheel_rl: VehicleWheel3D = $WheelRL
@onready var wheel_rr: VehicleWheel3D = $WheelRR
@onready var wheel_fr: VehicleWheel3D = $WheelFR
@onready var car: VehicleBody3D = $"."
var max_steering:float = 0.9
var engine_power:int = 3000
func _ready() -> void:
pass
func _physics_process(delta: float) -> void:
steering = lerp(steering,Input.get_axis("move_left","move_right") * max_steering,delta)
engine_force = Input.get_axis("move_back","move_forward") * engine_power
func _process(_delta: float) -> void:
print(steering, " ",engine_force)
print("FL Contact ",wheel_fl.is_in_contact())