Hinge Constraint on car not turning?

Hello, I made this script to make my vehicle function it goes forward fine. When I try to turn nothing happens it works when I manually. I used a print to constantly print the values and its working fine. Any ideas to fix it? Thanks for your help in advance.

local DriverSeat = script.Parent.VehicleSeat
DriverSeat:GetPropertyChangedSignal("Throttle"):Connect(function()
	for i,v in pairs(script.Parent:GetDescendants()) do
		if v.Name == "MotorConstraint" then
			v.AngularVelocity = DriverSeat.Throttle * 100
		end
	end
end)
local LeftTurn = script.Parent.Left.HingeConstraint.TargetAngle
local RightTurn = script.Parent.Right.HingeConstraint.TargetAngle
DriverSeat:GetPropertyChangedSignal("Steer"):Connect(function()
	LeftTurn = 30 * DriverSeat.Steer
	RightTurn = 30 * DriverSeat.Steer
end)
while wait(0.1) do
	print(RightTurn)
end

Try this

local DriverSeat = script.Parent.VehicleSeat

local LeftHinge = script.Parent.Left.HingeConstraint
local RightHinge = script.Parent.Right.HingeConstraint

DriverSeat:GetPropertyChangedSignal("Throttle"):Connect(function()
	for _, v in pairs(script.Parent:GetDescendants()) do
		if v.Name == "MotorConstraint" then
			v.AngularVelocity = DriverSeat.Throttle * 100
		end
	end
end)

DriverSeat:GetPropertyChangedSignal("Steer"):Connect(function()
	LeftHinge.TargetAngle = 30 * DriverSeat.Steer
	RightHinge.TargetAngle = 30 * DriverSeat.Steer
end)

thank you sir can you explain what I did wrong so I don’t make the mistake again

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.