How to use LayerCollector

I want to use LayerCollector to make GUI not reset when player respawns. I haven’t found any examples though, and I have no clue how to use it.
Documentation doesn’t really help out.

You just make its ResetOnSpawn property false?

1 Like


I wonder.

Use the .ResetOnSpawn property of the LayerCollector (ie the ScreenGui, BillboardGui, SufaceGui…), not StarterGui.ResetPlayerGuiOnSpawn.

Still resets the GUI for whatever reason.

Are your LayerCollectors descendants of objects that aren’t other LayerCollectors (ie a folder)? That will cause it to reset on spawn.

If not, could you show how your LayerCollectors are laid out and the properties panel?

hierarchy

ResetOnDeathDisable is the script that disables ResetOnDeath.

I see, you would need to change the property of the ScreenGui itself in the properties panel. AFAIK what it does when the player dies, is that it goes through the StarterGui, checks if the ResetOnSpawn property of the ScreenGui inside of the StarterGui is true, if it is, then copies it into the PlayerGui.

The reason it still resets is because when it “scans” the children of StarterGui, the ScreenGui inside of StarterGui still has its ResetOnSpawn property set to true. What actually runs on the client, is a copy of ResetOnDeathDisable which would disable ResetOnSpawn only on the copy of the ScreenGui inside of the PlayerGui

So I need to set parent of the ResetOnDeathDisable to anything other than in ScreenGui?

No, you would just need to set the ResetOnSpawn property of the ScreenGui to false in the properties pane, not through a script

I somehow did not notice that in the panel. Thanks.

1 Like

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