Inverted Steering Bug

I tested out my car steering earlier on, and I noticed that the steering is inverted, and I’m confused on how. Here’s my steering script.

wait(1)
SeatValue = script:WaitForChild(“Seat”)
if SeatValue:IsA(“ObjectValue”) and SeatValue.Value and SeatValue.Value:IsA(“VehicleSeat”) then
seat = SeatValue.Value
car = seat.Parent

if seat:FindFirstChild("RocketPropulsion") then
	seat.RocketPropulsion:Fire()
end
local RemoteControlled = car:FindFirstChild("ControlByRemote")
while seat:FindFirstChild("SeatWeld") and RemoteControlled do
	wait()
	if not RemoteControlled:IsA("VehicleSeat") then 
		break
	end
	RemoteControlled.Throttle = seat.Throttle
	if car:FindFirstChild("LeftMotor") then
		car.LeftMotor.DesiredAngle = seat.Steer*math.rad(45-RemoteControlled.Velocity.magnitude/4)
	end
	if car:FindFirstChild("RightMotor") then
		car.RightMotor.DesiredAngle = seat.Steer*math.rad(45-RemoteControlled.Velocity.magnitude/4)
	end
	if car:FindFirstChild("Configuration") then
		if seat.Throttle == 1 and car.Configuration:FindFirstChild("Forwards Speed") then
			RemoteControlled.MaxSpeed = car.Configuration["Forwards Speed"].Value
		elseif seat.Throttle == 0 then
			RemoteControlled.MaxSpeed = 0
		elseif seat.Throttle == -1 and car.Configuration:FindFirstChild("Reverse Speed") then
			RemoteControlled.MaxSpeed = car.Configuration["Reverse Speed"].Value 
		end
	end
end
if seat:FindFirstChild("RocketPropulsion") then
	seat.RocketPropulsion:Abort()
end

end
script:Destroy()

If it’s inverted, just multiply the final values by -1 to invert it back. There’s no point in trying to correct it using some secret super math.

3 Likes

Ditto. More specifically, check your seat.Steer values with prints to double check that your math is consistent to the desired effect (correct angle of steering) for testing purposes. Prints are always your friend in these scenarios.

Ditto here as well also if you are using the default Roblox Hinge Constraints then you have to additionally check the axis of the constraints represented by the brown golf tee. Remember the right hand rule depending which way the axis is pointing.

Screenshot 2020-11-03 at 10.25.49 PM

Thank you, I was struggling a bit on that, so thanks for your help, also, it worked.