I’m trying to achieve a proof of concept force feedback system for steering wheel using a modified version of “X360CE” but I’ve noticed that at times HapticService sometimes just doesn’t set the motor to any speed at all resulting in my steering wheel having no resistance or skipping a lot.
Is this a bug?
-- code snippet, everything is defined
UIS.InputChanged:Connect(function(obj)
if obj.KeyCode == Enum.KeyCode.Thumbstick1 then
local roundedsquare = tonumber(string.format("%.1f", tostring((obj.Position.X)^2))
local min = math.min(0.3, roundedsquare)
if roundedsquare == oldsquare then return end
if obj.Position.X > 0 then
oldsquare = roundedsquare
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Small, min)
elseif obj.Position.X < 0 then
oldsquare = roundedsquare
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Large, min)
else
oldsquare = roundedsquare
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Large, 0)
HapticService:SetMotor(gamepad, Enum.VibrationMotor.Small, 0)
end
end
end)