Touch buttons don't show up on mobile devices

Okay, I’m not sure if this is an engine bug or if I’m doing something wrong, but when I use this script I made to create touch buttons for mobile


CAS:BindAction("Pink", button1, true, Enum.KeyCode.ButtonL2)
CAS:BindAction("Yellow", button2, true, Enum.KeyCode.ButtonR2)

CAS:SetTitle("Pink", "Pink Portal")
CAS:SetTitle("Yellow", "Yellow Portal")

CAS:SetPosition("Pink", UDim2.new(.8, 0, .8, 0))
CAS:SetPosition("Yellow", UDim2.new(.8, 0, .6, 0))
print(UIS.TouchEnabled)

nothing shows up on my screen.

The touch buttons do exist in the explorer, as seen in these photos and according to the properties tab are visible and are at a position where I should be able to see it. But still, nothing shows up.

image
image

can anyone tell me what I’m doing wrong

Edit: Actually solved the problem myself, turns out ContextActionGui Wasn’t enabled, so anyone else with this issue, please check to make sure context action gui is enabled

edit 2: Actually, although the ContextActionGui wasn’t enabled, it won’t let me enable it. and it doesn’t automatically enable when I start a moblie client, please help

EDIT 3: okay I just realized the issue, I have a script in my game that doesn’t just disable that specific context action gui, it disables all of the player’s gui, it’s fixed now

2 Likes

RunService has function for where you booting from.
Try it.

wdym by, “function for where you booting”

do you mean it has a function that says whether I’m using the mobile or pc client?

Oh sorry, I meant this.
https://developer.roblox.com/en-us/api-reference/class/TouchInputService

I still don’t know what to do with this, the only functions here are functions and properties inherited from instance

Sorry, I meant this.
https://developer.roblox.com/en-us/api-reference/property/UserInputService/TouchEnabled

Yeah added that in too, it prints true

Then…
What’s console’s error message?
Is there destroying thing in GUI script?

there is no error message, and there isn’t a destroying gui thing

as I said, the gui exists in the explorer, it just doesn’t enable

Can you do enable to disable, or visible to invisible instead?

I have also tried forcing it to enable through the script, nothing

the only way it’ll be visible is if I go into the explorer and click enable

That means… GUI’s .Visible not working???

image
Change this to Scale

that’s not gonna change anything, like I said, if I go into the explorer, and click enable on the contextactiongui, everything is visible. But if I do it in a script, nothing happens

Maybe issue came from unseen side of script.

Can we see the script?

[fill in here lol]