Im making a game where I have a tutorial which covers the full screen. the issue is that after the frame becomes visible the mobile controls disappear and movement and camera movement combine for some reason
I tried to look on the forum but I can’t find anyone else with this same issue and I cant figure it out.
as you can see the mobile controls are gone (also tested on actual device) and if the player tries to walk it also moves the camera which is very annoying.
in my tutorial script I have a check for clicking/tapping and I’m 100% sure that its not some how clashing with the players movement.
inputservice.InputBegan:Connect(function(input, gpe)
if gpe or (input.UserInputType ~= Enum.UserInputType.Touch and input.UserInputType ~= Enum.UserInputType.MouseButton1) or not canclick then return end
I think this problem is with the GUI but I can’t figure it out since even if the frame becomes invisible the issue still persists.
In my current project, I disable & enable Roblox’s Jump button for different reasons, such as NPC cutscenes. Here’s (basically) how I do that (in a local script under StarterGui):
local JumpButton_Path
local success, errorMessage = pcall(function()
JumpButton_Path = game.Players.LocalPlayer.PlayerGui.TouchGui.TouchControlFrame.JumpButton
end)
if success then
JumpButton_Path.Visible = false
end
The PCall is there because players not on TouchEnabled devices don’t have the TouchGui (ScreenGui) under PlayerGui. Hopefully that makes sense. It’s all automatic by Roblox whether it’s there or not. On that note, I don’t fully understand your Input system checking here:
inputservice.InputBegan:Connect(function(input, gpe)
if gpe or (input.UserInputType ~= Enum.UserInputType.Touch and input.UserInputType ~= Enum.UserInputType.MouseButton1) or not canclick then return end
Indicates whether the game engine internally observed this input and acted on it. Generally this refers to UI processing, so if a button was touched or clicked from this input, gameProcessedEvent would be true. This is also true for input events connected via ContextActionService.
I don’t the think default Mobile jump button uses ContextActionService specifically, but it might be internally using the gameProcessedEvent. I don’t have all your code, but there’s a check in the code there for gpe. Removing that might change something. I also think the multiple ORs in the if statement are redundant if you’re only trying to check if the player would have the TouchGui.
I brought up the GameProcessedEvent stuff because of this also:
I’d assume if any UI is covering the screen that it’d go away or not work (if Roblox has GameProcessedEvent for the Mobile Jump Button). I could be wrong, sorry if that doesn’t help.