Duplicating Models With Optimal Performance

Hi, in my game I need to insert a house for a player when they join the game, the model of this house is custom for every player. I’m noticing lag spikes when players join as a model is cloned from inside ReplicatedStorage and placed into workspace, so I was hoping to do this more optimally.

From what I understand, calling Clone() and inserting new instances can be quite taxing on performance, but if I had a set of houses on stand-by somewhere in the workspace, then I could simply change their CFrame and put them in place when the player joins. Obviously though this would mean having a copy of every house spawned somewhere else in the workspace and I’m unsure whether this would affect performance just as negatively. (My guess is that having 50 houses off on the side has minimal effect if it means removing lag spikes when cloning, but I’m interested in what you think)

Obviously, the reserve would need to be replaced when a house is taken from there. So my next question is whether transfering parts of a house over one at a time (maybe over the course of 20 seconds say) would be less taxing than cloning the whole model at once? Or does calling Clone() 30 or so times slowly on individual parts affect performance just as much?

I hope this post was clear. I’d like to hear somebody’s thoughts on this, and whether you may have any other clever ideas? Thanks!

2 Likes

Normally what I do to make something appear is to put it in ServerStorage

The cloning of the decoration itself, I think it would be better than loading it whole but some parts are heavier

This may help you:

1 Like