I am making a racing game and I want to change the VehicleWheel property "Friction Slip"
My car scene looks a bit like this:
Spatial Car
Car mesh
VehicleWheel
Wheel mesh
VehicleWheel1
Wheel mesh 1
VehicleWheel2
Wheel mesh 2
VehicleWheel3
Wheel mesh 3
And the spatial node at the top has the script attached. The script is pretty long and I don't think it is necessary to show the whole script but I could be wrong and if you do need the whole script than I can post it, but the part that matter goes like:
var wheel1 = get_node("VehicleWheel")
var wheel2 = get_node("VehicleWheel2")
var wheel3 = get_node("VehicleWheel3")
var wheel4 = get_node("VehicleWheel4")
func _physics_process(delta):
if Input.is_key_pressed(KEY_D):
wheel1.set("Wheel/Friction Slip", 1.5)
wheel2.set("Wheel/Friction Slip", 1.5)
wheel3.set("Wheel/Friction Slip", 0.5)
wheel4.set("Wheel/Friction Slip", 0.5)
elif not Input.is_key_pressed(KEY_D):
wheel1.set("Wheel/Friction Slip", 10.5)
wheel2.set("Wheel/Friction Slip", 10.5)
wheel3.set("Wheel/Friction Slip", 10.5)
wheel4.set("Wheel/Friction Slip", 10.5)
I don't know what I'm doing wrong, I have tried some other things as well but I can't get it to work. The Friction Slip won't change no matter what I do. Thanks for any help!