What do you want to achieve?
I want mobile to function normally after I morph the player. This is only a mobile issue, since everything works fine on PC (I have not checked console)
What is the issue? Include screenshots / videos if possible!
The movement buttons/joystick (like jumping) don’t appear when I morph the player. They should appear. You can still move. Also (I’m assuming because of the same bug) when you move the camera moves.
Notice how when I spawn as the operator, I can still move around but there’s no joystick or jump button, and when I do move the camera moves with it. When I jump into the void and die, the bug is fixed. Not shown in the video but when I reset nothing changes. I have a script that morphs the character again when you die/reset, so that is why I assume. (The death script doesn’t trigger if you jump into the void, which won’t be a problem when the game is done)
These are the scripts that manage the menu setup and changing the gui. One of them is a local script, and the other is a moduleScript in a module loader
Gui handling module script, in ReplicatedStorage:
function guiManager:setGui(...)
-- Function Variables --
local args = {"Transition",...}
-- Set Player Guis --
for _,menu in plr.PlayerGui:GetChildren() do
if not menu:IsA("ScreenGui") then continue end
if table.find(args, tostring(menu.Name)) then
menu.Enabled = true
else
menu.Enabled = false
end
end
print(script.Name.. ": " ..plr.Name.. "'s Gui Set")
end
Player setup local script, in StarterPlayerScripts
function SetupHandler:Start()
-- Set Player's Camera, Gui, and Music --
camModule:setCam(Enum.CameraType.Scriptable, workspace.MenuArea.MainCamera)
guiModule:setGui("Main","LoadingScreen") -- The mobile GUI disappears here
soundModule:playSound("MenuMusic")
guiModule:setCoreGui("ResetButtonCallback",false)
print(script.Name.. ": " ..plr.Name.. "'s Menu Setup Complete")
end
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’m not sure how to design my game for mobile, so I don’t really know where to begin looking. We do intend to support mobile though, which is why this has become an issue.
EDIT: Updated post significantly. Removed irrelevant scripts and updated with ones that have shown to be the problem.
Can you test in Roblox Studio and look at your character through the Explorer? Have you tried using another morph, or disabling some of these scripts? Most likely, roblox is having an issue with one of the important parts of the charcter(unless you are disabling the controls somewhere else). I would double check it works with a normal character and some of that code commented out to make sure you don’t have another script elsewhere messing with things.
Can’t right now but will get back to you on this tomorrow. Not sure what I’ll comment out since almost every part of my scripts are important to the functionality of the rest of it but I’ll see what I can test.
Hey sorry I took so long to get back to you on this… I added waits in between code in the script I have that sets up the menu as such:
function SetupHandler:Start()
-- Set Player's Camera, Gui, and Music --
task.wait(10)
camModule:setCam(Enum.CameraType.Scriptable, workspace.MenuArea.MainCamera)
task.wait(10)
guiModule:setGui("Main","LoadingScreen") -- The mobile GUI disappears here
task.wait(10)
soundModule:playSound("MenuMusic")
task.wait(10)
guiModule:setCoreGui("ResetButtonCallback",false)
print(script.Name.. ": " ..plr.Name.. "'s Menu Setup Complete")
end
The mobile GUI only disappeared after the line I marked with comments ran. I’ve narrowed it down to something in this script that handles the player GUI by doing it:
function guiManager:setGui(...)
-- Function Variables --
local args = {"Transition",...}
-- Set Player Guis --
for _,menu in plr.PlayerGui:GetChildren() do
if not menu:IsA("ScreenGui") then continue end
if table.find(args, tostring(menu.Name)) then
menu.Enabled = true
else
menu.Enabled = false
end
end
print(script.Name.. ": " ..plr.Name.. "'s Gui Set")
end
I realize that I did not include either of these scripts in my original post (as I somehow failed to think that the script handling the GUI… would cause the GUI to bug… which in hindsight is my fault) I will be updating the post to include this and remove most likely irrelevant information.
Yes, mobile buttons are part of the ScreenGui called “TouchGui”. I would add that with the “Transition” ScreenGui at the start of your args array. That way it shouldn’t be disabled. And if it doesn’t exist in PlayerGui(for PC players), then no problem.