I’m experiencing a problem where my SurfaceGuis break when I reset. I cannot click on the buttons or anything. This only happens when they’re set from the StarterGui.
I found something relating to the issue here:
However, this issue looks like it was marked as resolved a while back and I’m confused why I’m still experiencing it. I have also tried altering the ResetOnSpawn property on the SurfaceGuis, but nothing has changed (I only tested this part in studio, didn’t think it’d have much difference in game, but I could be wrong)
I’ve seen a lot of people have this problem (including myself). If you don’t want the UI object to be recreated when you reset (which destroys all event listeners on every object in the UI), disable the ResetOnSpawn property in the SurfaceGui object.
I’m honestly not sure why this property exists at all. It seems to be more headache inducing than helpful. If this solved your problem, make sure to mark this post as the solution!
This is the solution that I’ve seen on the previous topic & on the Wiki, however it still occurs. I disabled the ResetOnSpawn property and it still happens when I reset. This time, I checked in game and in studio and results are the same.
It does appear to be, but I’m surprised no one has brought it up recently if the bug is back since the last time they fixed it (unless I’ve just missed it). Any temporary solutions or should I wait for a solution/bug fix?
Where is the connection for the clicking made inside the script, where is the script located? Can we see the whole script? There could be a lot of things like wrong references and such causing this behavior
repro.rbxl (18.7 KB)
This is a shortened version of the script that I compiled, but the same issues are present.
Where is the connection for the clicking made inside the script, where is the script located? Can we see the whole script? There could be a lot of things like wrong references and such causing this behavior
LocalScript - Pastebin.com < this is the full script from the LocalScript, the full script of the FireAllClients script is found above, and that’s in its full form.
The location of the script is here:
while the FireAllClients script is in ServerScriptService.
The reasoning behind why this happens is every time a player dies, all screen gui contents with “ResetOnSpawn” set to false are kept and everything else is removed. Then, the new contents of the playerGui (that do not already exist) are cloned in.
As long as your billboard gui is not directly patented to the playerGui (starts in starterGui), you will be fine, as long as that object has ResetOnSpawn set to false as well.
Uh, what do you mean by this? The only purpose of StarterGui is for the server to clone child objects into a player’s PlayerGui when their character spawns. The location has nothing to do with the behaviour of ResetOnSpawn. Whether you parent it directly to PlayerGui or not, ResetOnSpawn will prevent the Gui from being destroyed when the character respawns.