So I use a culling function on most games I develop for that works like this:
The interior of buildings that are enterable for players are made in a way that the interior is separate from the exterior, this model is placed into the replicated storage area of the game. Everything interior wise, aside from objects that have to be interacted with the player are culled away in this fashion.
When a player enters the building, they prompt the server via either a proximity prompt, or a passive sensor that detects the player’s humanoid. When this is triggered, a signal is sent to the local part of the script to retrieve a copy of the specified interior and place it locally into the game.
The idea is this physically removes the interiors of unoccupied buildings when they arent in use, reducing the load on the game that has to be rendered and calcuated.
In practice this works well, I have no complaints about this method other than one, and its where I want to know if there is a better solution to achieve the same goal. Upon loading the interior, it causes a breif lagspike, it’s not a game-ending problem, but its one that players notice and they do complain about. When using the proximity prompt method its not that noticeable even to players as they are teleported inside, whereas the passive method is more noticeable, but its necessary for some areas.
What can I do to mitigate this for a smoother experience?