ScreenGuis with ResetOnSpawn enabled are deleted after respawn

In my game, I have some ScreenGuis with ResetOnSpawn enabled. I will already state that the ResetOnSpawn is NEEDED to be enabled for them due to how their work, I can’t disable it.

When a player respawns, it seems like all the ScreenGuis with ResetOnSpawn enabled are reparented to the PlayerGui for less than a second, but then they’re instantly deleted, breaking the whole game specially because there is a spawn menu. Only the ScreenGuis with ResetOnSpawn disabled are kept.

I haven’t tried anything because I can’t think of any possible solution really. Here’s what’s happening:

Ideally you should store all UI elements in ReplicatedFirst and parent them to PlayerGui manually.
There is a lot of reason why it makes sense to do that but that would be too long to explain.
Also it ensures that all UI elements is replicated becouse scripts in ReplicatedFirst only run after every object inside ReplicatedFirst are well replicated.

Either way, what’s happening to me is not expected behavior and StarterGui still is supposed to be used.

Also even if I parented them to the PlayerGui through ReplicatedFirst, the issue would most likely still happen since it’s related to the ResetOnSpawn property.

Reading from ResetOnSpawn:

When set to true (default), or if this LayerCollector is an indirect descendant of StarterGui, it will be cloned into each player’s PlayerGui when their character respawns, and it will delete itself when the player’s character respawns again.

ResetOnSpawn will make any ScreenGui get destroyed and then reinstantiated, so I don’t think you have any solution for this (what requires ResetOnSpawn to be enabled anyway?)

ResetOnSpawn destroys it and reparents it back to the PlayerGui. It’s not meant to be permanently destroyed or destroyed again a second after it’s reparented.

Something interesting with this bug is that it’s only happening in the client. I checked from the server’s view, all the ScreenGuis are there as they were meant to. They only go away in the client.

I have no scripts that delete any ScreenGui under any circumstances.

It doesn’t appear like your UI gets parented after you reset. Roblox is cleaning up the old UI and getting ready to clone StarterGui again once the character is reloaded. This is intended behavior with ResetOnSpawn enabled. Do you call LoadCharacter again after resetting?

No, LoadCharacter is never called in any script.

Though, if you check in the clip in the original post, there’s a small set of frames with less than a second of duration where the gui loads, but then is destroyed immediately afterwards. In the last seconds of the clip, you can even see the Play button and the camera’s CFrame is changed, indicating the script under the ScreenGui ran and that it was parented back to the PlayerGui, but I think maybe destroyed right after? It’s very strange honestly.

That’s not the case whatsoever, the GUI will never load again since the character is never instantiated via LoadCharacter. Just to make sure that this is the case, can you send a video of you resetting while also clicking on one of the UI w/ ResetOnSpawn enabled so I can see it remove?

CharacterAutoLoads is enabled.
Edit: Accidently clipped the background sound too lol.

I honestly don’t know what could be causing this issue… I haven’t really ran into this before. You don’t have any Server scripts touching UI correct?

No, I’ve tried using search all too, and I really don’t see anything. Also this issue was fixed a week ago when I changed the StarterCharacter (nothing really new, really just changed the StarterCharacter to add default Shirt, Pants, and others), and then suddenly today, for absolutely no reason, it’s back.

Hello.

This bug stopped happening randomly again after literally zero changes on the game. Feeling like this is an actual bug than something related with my game considering this is the 3rd time it just comes back and then goes away suddenly. Anyways.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.