I've just started to learn Roblox this week, but I can't find anywhere that talks about the best practices for this. Given a UI with spawnable elements, (in my case towers for a tower defence), where would these be stored? I don't want them present in the workspace as they're not needed in the game until spawned, but I still need to be able to edit them. Would the best be to store them in a place and them retrieve them with an id?
I know this is common practice for experienced developers, so I appreciate your patience. Please also let me know if you need better clarification on what I'm trying to achieve.
ServerStorage
and ReplicatedStorage
. If you want the stored objects to be inaccessible by clients, use ServerStorage
. If you want client-server access, use ReplicatedStorage
. This is where RemoteEvent
s and RemoteFunction
s go, as the server and client need to access them. It is a common practice to use Lighting
to store objects, however this is bad practice and is unsupported by ROBLOX.