Can`t get button to work CrossPlatform (Not in Local Script)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want a button that is inside a SurfaceGui inside a part inside the workspace to work on all platforms

  2. What is the issue? Include screenshots / videos if possible!
    at the moment I use MouseButton1Up and MouseButton1Down. wich only works for Pc

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    .Activated – needs to be in a local script??
    .InputBegan – needs to be in a local script
    .Touched – needs to be in a local script

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- the script is a child of the button
script.Parent.MouseButton1Down:Connect(function()
	print("activated by .MouseButton1Down")
end)


script.Parent.TouchTap:Connect(function()
	print("activated by .TouchTap")
end)

script.Parent.Activated:Connect(function()
	print("activated by .Activated")
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

Buttons don’t work in scripts. Activated works both on mobile and pc, I prefer using Activated than MouseButton1Down. Parts can have surface guis not screen guis. Here is a article about surface guis if you dont know what it is.

1 Like

that is my bad. i ment a SurfaceGui, but Typed Screen gui

1 Like

Buttons in SurfaceGuis do not work when the SurfaceGui isn’t parented to the player’s PlayerGui. Parent the SurfaceGui to StarterGui, set it’s adornee to the part you want it to show up on, and change the script into a LocalScript.

going through all my old posts to close them.
buttons used the way described above do work for pc. but not for other platforms (roblox issue)

there are 2 possible solutions.

1:
-stop the loading of the player
-create a script that moves all surfacegui`s into startergui

  • load player

2:
every surfacegui in starterplayergui and just long references to the blocks.