How to optimize my game so its less laggy!

I want to optimize my game so that it’s less laggy.

The issue is when a player is on the tracks running at high speeds, the game gets really laggy and pretty much unplayable.

I have changed the CollisionFidelity set to ‘box’ for almost all the assets we have in the game. I believe that a majority of the lag comes from loading all 10 tracks in at once, thought of setting up so if a player is on one track, the other tracks are unloaded.

image

Currently have almost 1.2mil instances running…

What can I do to stop this lag?

3 Likes

Well for starters 1,163,243 instances is a LOT of stuff in the game. If you can reduce the number it’d help a lot since the game is trying to render each one. MeshParts may help with reducing the number of Parts. If you can have less tris (less faces) on on a whole bunch of MeshParts that can help with performance too. For example I wouldn’t expect the trees in the next track over to be Meshparts with more than about 5-600 tris each.

Do you have CanTouch enabled for all of the Parts? If so try removing that. It helps keep the engine from trying to calculate if those parts are being touched.

If you do end up only loading 1 track maybe load in the tracks on either side for visual reasons to let players see them.

6 Likes

So we went ahead and decided to load one track in for each level, and I have both Collision and CanTouch OFF! The lag has reduced a ton but persists when the player reaches high speeds and runs down the track. Assuming this has to do with Roblox keeping up with loading the rest of the tracks.

1 Like

You could de-load the levels that the player isn’t next to.

1 Like

Try streaming enabled option to unload objects far away and put RenderFidelity on MeshParts to performance

1 Like