My game is SUPER laggy

I know I have a lot of objects but does anyone know how I can reduce the lag?

1 Like

Oh, probably the fact that everything’s checking for collisions at once :upside_down_face:
I’d make a UI object that looks like a loading screen, and once everything’s spawned it disappears.

Also u can use raycasts.

When are they checking for collisions?
And how would raycasting help?
Also, the lag is more for when I try to edit after testing. It crashes every time.
Sorry, I’m really dumb.

You can use the Performance metrics to understand what’s affecting your game performance; here are two screenshots that I took while your game was running:
image

As you can see, at the beginning of the game when the game is generating the terrain - there is a lot of Spawns, Proximity, and Destroyers in use.

And then when the game starts, it’s the proximity that it’s affecting the performance.

Try to turn off logic (such as stopping the proximity checks once the generating is done) or delete objects that are no longer needed in the level.

You can also try to limit the amounts of objects you spawn at once. Btw is this system from TinkerSmith/Brickccentric, or did you do it by yourself?

5 Likes

Thanks a lot!

I did it by myself. Why?

1 Like

Cuz the generation’s kinda dope :sunglasses:

1 Like

Thanks! (Except the lag is horrible)

1 Like