I can usually debug and make work arounds on my own, but this is really bugging me right now.
I’m trying to hide the TouchGui once the game is fully loaded (by waiting for game.Loaded event to fire), however as soon as I set it’s Enabled state to false, it almost instantaneously re-enables itself.
Without having to use task.wait or anything hacky like that (if at all possible), what do you guys suggest? Thanks!
Edit after solution: Really no other way other than to call the deprecated function. However I would like to point out that even though the GUI is invisible, they can still control their character. So disable the controls too, as you use this function.
if not game:IsLoaded() then game.Loaded:Wait() end
game.Players.LocalPlayer.PlayerGui:WaitForChild('TouchGui').Enabled = false
-- Apparently this isn't working as it re-enables itself
-- i have to either use task.wait() or something before running this code...
This isn’t how I write my code, but its a quick dirty example for the sake of clarity
It really wouldnt make a huge difference and I’m trying to control things from modules in PlayerScripts folder (StarterPlayerScripts) just to test things out in new ways of architecture.