I’ve read the thread above, seems like it’s a thing.
Here’s my Haptic Feedback, it’s just not firing the vibration despite doing everything, and the prints work.
Anyone developers have experience with firing these? I hate loading up my iPhone to not get any haptics.
It fires fine via the ‘ROBLOX Studio Mobile Testing Client’, but I don’t see any controls, does anyone know how to get this going?
Haptic Feedback Module:
local HapticFeedback = {}
local HapticService = game:GetService("HapticService")
function HapticFeedback.triggerMediumVibration()
task.spawn(function()
if game:GetService("UserInputService").TouchEnabled then
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 1)
task.wait(1)
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 0)
else end end)
end
function HapticFeedback.triggerLowVibration()
task.spawn(function()
if game:GetService("UserInputService").TouchEnabled then
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 0.5)
task.wait(0.2)
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 0)
else end end)
end
function HapticFeedback.triggerCriticalVibration()
task.spawn(function()
if game:GetService("UserInputService").TouchEnabled then
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 1)
task.wait(2)
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 0)
else end end)
end
function HapticFeedback.triggerSpecialVibration()
task.spawn(function()
if game:GetService("UserInputService").TouchEnabled then
for i = 1, 3 do
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 1)
task.wait(0.3)
HapticService:SetMotor(Enum.UserInputType.Touch, Enum.VibrationMotor.Large, 0)
task.wait(0.3)
end
else end end)
end
function HapticFeedback.__init()
-- this is fine, this isn't an issue. I can fire, cast, and use this fine, but it doesn't wanna make my [Haptic] work. lol.
end
return HapticFeedback
Yo, if anyone or you can get Haptics on any device I guess to work, wanna let me know…
I don’t wanna pull up my iPhone and test haptics today, but if it works, maybe I’m doing something wrong via my iPhone settings.
Additionally, I’ll post an update if I get this running.
EDIT: 7:56am
I think it could be a motor setting or something, I have other more important systems to program for my game today, so I don’t want to hold up on this.
I’ll play with the isMotorSupported and cast a visual UI open to see if it should be firing.
This system for my game isn’t mandatory, but would be a really awesome feature for my mobile players & Console. -[[yes, i know my code doesn’t have console in mind yet]]-
We use HapticService for our generic buttons and offer mobile support (tested on iPhone 12 Pro Max, iPhone 13 Pro Max, 14 Pro Max). We give 8 haptic vibration options and they play for a very short period of time (talking a couple frames) but I should be able to help you out.
We don’t check if IsVibrationMotorSupported because I found it a bit of a hassle to set up at the time but should probably set it up going forward but I digress.
I don’t remember where I saw it but I did see somewhere that vibrations on mobile will only work with the Gamepad1 UserInputType, not touch which is why you aren’t receiving any haptic feedback. We do set the motor’s vibration intensity for the touch InputType as a fallback but in most if not all cases you will need to use Gamepad1, not Touch. It’s quite a mess but it works: