Machine malfunction

So here I have a server script inside a machine, but for some reason the machine is not behaving properly. You can check it yourself by downloading the machine file (attached below). Also below is the script.

Please help me to understand what I wrote wrong.

local seat = script.Parent.VehicleSeat

local backLeft = script.Parent.BackLeft
local backRight = script.Parent.BackRight

local frontLeft = script.Parent.FrontLeft
local frontRight = script.Parent.FrontRight

local steerAngle = 30
local speed = 60

seat:GetPropertyChangedSignal("Steer"):Connect(function()
	frontLeft.PartB.SteeringConstraint.TargetAngle = steerAngle * seat.Steer
	frontRight.PartB.SteeringConstraint.TargetAngle = steerAngle * seat.Steer
	
	print("Left: ".. frontLeft.PartB.SteeringConstraint.TargetAngle, "Current Right: ".. frontRight.PartB.SteeringConstraint.TargetAngle)
end)

seat:GetPropertyChangedSignal("Throttle"):Connect(function()
	frontLeft.Wheel.WheelConstraint.AngularVelocity = speed * seat.Throttle
	frontRight.Wheel.WheelConstraint.AngularVelocity = speed * seat.Throttle

	backLeft.Wheel.WheelConstraint.AngularVelocity = speed * seat.Throttle
	backRight.Wheel.WheelConstraint.AngularVelocity = -speed * seat.Throttle
end)

Car4.rbxm (10.1 KB)

Your Front Right wheel is moving in the wrong direction, make it negative.

can you give me the example please

add negative sign before speed. It’s that simple.

1 Like


    frontRight.Wheel.WheelConstraint.AngularVelocity = - speed * seat.Throttle

Like this?

Yes, it should work fine after adding the negative.

1 Like

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