im making a car, and im having a problem:
code:
local seat = script.Parent.VehicleSeat
local steerAngle = 30
local speed = 60
seat:GetPropertyChangedSignal("Steer"):Connect(function()
script.Parent.drivetrain.FL.sus_b.HingeConstraint.TargetAngle = steerAngle * -seat.Steer
script.Parent.drivetrain.FR.sus_b.HingeConstraint.TargetAngle = steerAngle * -seat.Steer
end)
seat:GetPropertyChangedSignal("Throttle"):Connect(function(spd)
print(spd)
script.Parent.drivetrain.BL.steer1.HingeConstraint.AngularVelocity = speed * seat.Throttle
script.Parent.drivetrain.BR.steer1.HingeConstraint.AngularVelocity = speed * -seat.Throttle
end)
everything is working fine, but in the throttle function, it doesnt work. i tried to check what the problem is by printing the amount, but i got nil
in the output.
how do i fix this?