I have been creating a bomberman game and decided to finally make some mobile controls for it. I added some code to check if the player is on a mobile device and if true then it connects functions to the buttons, else, it destroys them. I know they worked because I can see them and Touch works. The problem is that when I hold the walking button the buttons I created can't be activated. Any Idea why this happens? I know my mobile device can do multi touchs because in other apps it sure can! Here is the code for the Touch event:
local UIS = game:GetService("UserInputService") local GuiService = game:GetService("GuiService") if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled and not UIS.GamepadEnabled and not GuiService:IsTenFootInterface() then--Checks if mobile script.Parent.TouchButtons.Place.TouchTap:Connect(function() game.ReplicatedStorage.Events.CreateBomb:FireServer(char.HumanoidRootPart.Position+Vector3.new(0,5,0)) end)--BindtoTouch script.Parent.TouchButtons.Explode.TouchTap:Connect(function() game.ReplicatedStorage.Events.RemoteExplode:FireServer() end)--BindtoTouch else script.Parent.TouchButtons:Destroy()--If not mobile, destroy the buttons end
Also, thinking the problem was that somehow Roblox movement TouchPad GUI would get a higher ZIndex when touching them, I have set my buttons ZIndex to 10 to see if it would fix the problem and it didn't.