I have UI that blocks the mobile movement UI so I tried to change the ZIndex of the mobile UI. However, my script didn’t quite work. There are no errors or anything meaning the ZIndex does exist here.
Script:
if Player:FindFirstChild("PlayerGui"):FindFirstChild("TouchGui") then
local TouchUi = Player:FindFirstChild("PlayerGui"):FindFirstChild("TouchGui")
print("Touch UI found")
local TouchControlFrame = TouchUi.TouchControlFrame
TouchUi.ZIndexBehavior = Enum.ZIndexBehavior.Global
TouchControlFrame.ZIndex = 99
else
print("No touch UI found")
end
You actually can’t bump the default touch controls, ZIndex from PlayerGui as they live in CoreGui and always draw on top.
there is the option of hiding the default touch GUI and making your own via StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)) and drawing custom buttons with whatever ZIndex you like ( or you could lower your own UI ZIndex so the built-in sits above it )
The reason this doesn’t work is because ZIndex only works for all instances or siblings under the ScreenGui (depending on what you set it to.). What you need to do is set DisplayOrder of TouchGui to 100, or higher than your UI’s display order.