Removing models without LAG!

So my issue is that my game lags way to much it is playable but its really bad.

When i play the game and set it on performance stats it shows that my ping and Network (Received) is getting red and i guess that is a server-side issue.

My scripts are basically just spawning in cars at one side of a road then at the end of the road they get :Destroy() but anytime i destroy the model it causes lag so right now I am just changing the parent from “Workspace” to “nil” but i have no clue if that helps and it still lags. I really dont know how to reduce the lag for my spawning cars. I just want them to spawn in, drive for a bit then get removed and new cars spawns in at the spawning point doing the exact same thing without lag.

Here is a GIF of the curent state → https://gyazo.com/8af6687597d644fb52c4ba783e312571

Any help is needed!

1 Like

yeah destroying will cause lag as it has to replicate to all clients same thing with setting the parent to nil.

Assuming the model is welded you should just be able to use something like part cache to avoid creating new models and destroying them.

So i would just want to CFrame the models to a place really far away then CFrame them back to the spawning point?

I have tried to move the models to the spawn point again instead of destroying them when they reach there destination but that causes such a spike lag but i could try moving them far away and move them back and see if it fixes the lag.

Another issue that could be causing lag is physics. If your instances aren’t anchored they’ll have constant physics applied which can build up.

That is probably the issues as the model is welded for it to move with wheels. I tried using anchored models and tweening movement but it looks so bad and the best way for it to look good is by using spinning wheels making the car move on it self but i guess that makes the lag…