SurfaceGui Button input registering not working on mobile?

So basically just like it says in the title, I am locally enabling a surface gui for a certain player. The only huge problem is that the surface gui button on mobile doesn’t seem to register any input.

Here’s an example on PC ;


Here’s an example on Mobile ;

I tried every possible way to register the mobile’s input, either it’s Activated, MouseButton1Down or even TouchTap doesn’t seem to work at all. I get no error either or any print that is inside those event.

Here’s what the script looks like when clicking on the button.

local Players = game:GetService('Players')
local event = game.ReplicatedStorage:FindFirstChild('Event'):FindFirstChild('ExitStationEvent')
local event_2 =  game.ReplicatedStorage:FindFirstChild('Event'):FindFirstChild('FireToAllClientDisablePrompt')
local player_ownership

local btn = script.Parent
local model = btn.Parent.Parent.Parent

btn.Activated:Connect(function()
	print("activated")
end)

btn.MouseButton1Down:Connect(function(x,y)
	warn('Closing gui')
	player_ownership = model:FindFirstChild('player_ownership').Value
	if player_ownership then
		if workspace:FindFirstChild(player_ownership) and workspace:FindFirstChild(player_ownership):FindFirstChild('Humanoid') then

			event:FireClient(game.Players[player_ownership])
			event_2:FireAllClients(game.Players[player_ownership], script.Parent.Parent.Parent.Parent:FindFirstChild('Interaction'):FindFirstChildWhichIsA('ProximityPrompt'), true)
			btn.Parent.Parent.Parent:FindFirstChild('player_ownership').Value = " "
			btn.Parent.Enabled = false
		end
	end
end)

try use MouseButton1Click instead of MouseButton1Down.

Wow, any special reason for that? Why wouldn’t all the other work as intended ?

MouseButton1Down doesn’t work on mobile to my knowledge. MouseButton1Click is the all-around version of UserInputType.Touch.

So basically, TouchTap won’t work on serverside button, good to know.

1 Like

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