So, I’m creating a MTB (mountain bike) chassis, and I’m currently on the steering portion. Right now I have two parts connected w/ attachments to make a servo. The servo’s target angle is set based on a VehicleSeat’s Steer
value. -1 being -12 degrees, and 1 being 12 degrees.
Now: it usually works fine; but - on occasions - it will start moving between -12 degrees and 12 degrees back and forth without any input from the player or script. Does anyone know anything I can do to prevent this?
The steering function
function SteerChanged()
if Seat.Steer == 1 then
Servo.TargetAngle = -TurnAngle
Lean.Torque = Vector3.new(0,0,LeanTorque)
elseif Seat.Steer == -1 then
Servo.TargetAngle = TurnAngle
Lean.Torque = Vector3.new(0,0,-LeanTorque)
else
Servo.TargetAngle = 0
Lean.Torque = Vector3.new(0,0,0)
end
end
I have tried messing with debounces, wait(), and the Lean Torque constraint.
Thanks, -sansprosii