Bug or other issue with collision?

Okay, I have a system sort of like that already on some objects. Will that actually decrease lag? I’m assuming since it disables physics then yes?

1 Like

Yes because disabling an object takes away its hitbox which means it can’t move, be interacted with, and can’t be found by other objects.

Another huge lag issue could be how many objects are active at the same time / how many hitboxes Flowlab is loading at once.

1 Like

Ok, thanks for the info. So if something only gets loaded once, it shouldn’t really cause lag besides at the beginning?

Not true, for objects to find, interact, and collide with each other, the hitbox has to be always active.

Turning off / disabling objects will help with lag because its like it doesn’t exist until you turn it back on.

1 Like

So even things like static level objects should get disabled when not in view/use to reduce lag as much as possible?

Correct

There are a few more lag helping techniques, but this will overall fix your game.

1 Like

What other things would you recommend?

1 Like

@johnpost, another way to help reduce lag is to make long walls and floors.

Every 32x32 (1x1) block has its own hitbox.
So to reduce the amount of hitboxes in the game, you could make a long 160x32 (5x1) floor object.

1 Like

I may have been mistaken about the cause of the lag before, or it could have been other lag sources mixing with the rays. Either way, I’ve implemented other lag-reducing measures and it SEEMS to be all good now. The rays don’t have much of an impact as far as I can tell, like you said. If I encounter it again I’ll let you know how to reproduce.