ReplicatedStorage or StarterGui

I’ve been looking at lots of posts lately about how you should never use the StarterGui and that you should always use ReplicatedStorage to clone the UIs into the PlayerGui instead. But then I also see lots of posts where people always leave their UIs in StarterGui and then make them visible and invisible when they need to.

My question is whether I should …

Make my UIs, place them in ReplicatedStorage and then clone them into the PlayerGui when I need it for the gameplay

OR

Make my UIs, place them into StarterGui, and then toggle its visibility for when I need it for the gameplay

Also, it would be extremely helpful if you explained why you chose what you chose because it would really help me understand this :slight_smile:

Thanks,
@ValiantWind

4 Likes

Imo, yo should place your gui’s in replicatedstorage UNLESS they are used almost the entire time the player is in the game, main gui’s that are constantly shown can just be in startergui, no point in not having them there, and it generally makes things a tiny bit simpler.

2 Likes

put them in startergui, there’s no reason to put them in replicatedstorage

1 Like

Then how come some devs choose to clone the guis through ReplicatedStorage instead?

2 Likes

pretty sure it’s all about said person’s preference(s)

2 Likes

It honestly depends on what your UI is supposed to do. If it’s a UI that is shown all the time (or almost all the time), then I’d choose StarterGui and manage it’s visibility when needed.

However, if the UI is used only from time to time, cooying it from ReplicatedStorage seems like a better option to me.

3 Likes

Unless this was patched recently it has to do with the fact that if you leave elements in StarterGui then the server will have a copy of all the GUIs in the game cloned for every player that joins, which is a waste of memory because the server doesn’t do anything with a player’s UI anyway since it’s all handled on the client.

Storing GUIs in ReplicatedStorage, however, ensures that the server only has one copy of the game’s GUI. Just have a folder of all your game’s GUIs and clone it into the client’s PlayerGui then change the visibilities of each element whenever you need them.

If you have a big game with lots of GUIs and images and lots of players playing at once, keeping GUIs in ReplicatedStorage could cut down your server memory usage a significant amount.

The following video touches on this in the end after explaining other reasons to clone from ReplicatedStorage (big game saved a whole gigabyte of memory):

9 Likes