Some mobile events don't work in Studio

The only mobile events that seem to work when emulating mobile in Studio are TouchStarted, TouchMoved, and TouchEnded. Other events like TouchSwipe or TouchTap do not work in Studio. (They do still work on actual mobile devices.)

I’m not sure if this is a new bug or an existing bug since I haven’t done mobile stuff before on here. It makes testing on mobile a pain though, since I only have Android devices and there’s no app for testing on Android.

Here’s a place that connects to all available Touch events from UserInputService. Try it out both in Studio device-emulated mode and on an actual mobile device. Compare console outputs.

If you want to test yourself, here’s the code from the linked place above. Throw it into a LocalScript inside of StarterPlayerScripts:

local userInput = game:GetService("UserInputService")

userInput.TouchEnded:connect(function()
	print("Touch Ended")
end)

userInput.TouchLongPress:connect(function()
	print("Touch Long Press")
end)

userInput.TouchMoved:connect(function()
	print("Touch Moved")
end)

userInput.TouchPan:connect(function()
	print("Touch Pan")
end)

userInput.TouchPinch:connect(function()
	print("Touch Pinch")
end)

userInput.TouchRotate:connect(function()
	print("Touch Rotate")
end)

userInput.TouchStarted:connect(function()
	print("Touch Started")
end)

userInput.TouchSwipe:connect(function()
	print("Touch Swipe")
end)

userInput.TouchTap:connect(function()
	print("Touch Tap")
end)
2 Likes

This isn’t a bug so much as we don’t simulate touch gestures in Studio. Most gestures are difficult to simulate (e.g. pinching requires two fingers, you only have one cursor) and various emulators have come up with their own solutions, but it’s not trivial.