Entering levels normally causes EXTREME lag/slowdown

When starting any level directly, be it from the editor or just by starting the game, everything is fine, but when you enter any levels using the designated level selectors, it slows to a crawl.
Here’s my game: https://flowlab.io/game/play/2204178

Could there by any explanation or simple fix I could implement? Or will I have to refactor heaps of code?
If this is a bug on flowlabs part imma melt

The game isn’t really slow for me, only a couple of frame drops when the levels load.
My suggestion is to try to remove the number of objects that are in the game.
A good way of doing this is changing 1x1 blocks into long columns or rows.
Or like changing your 1x1 x blocks into 5x5 blocks.

You can also use the “in-view” behavior to make things start when they go into the frame of the camera.

1 Like

The game works fine unless i use the “load level” block. The “in view” suggestion may help, but it doesn’t cater to my problem

From what I see, the lag is caused for 2 reasons;

  1. A lot of objects are being loaded at once so reducing the number of objects can help.
  2. At the start, a lot of objects use proximity all at once and that can take a lot of load, which is why I suggest the in-view behavior.

I hate. uh. something? I found the issue. When I loaded into the game previously, there was an FPS block handling the physics. The player ship keeps through levels and therefore doesn’t activate once triggers when going between levels. FPS also resets to 30(I think) every time you load a new level, so the fps change that made the physics work previously just kind of didn’t activate.

I moved the FPS code into a different object

1 Like