[SOLVED] How do I make a collision check every .2 seconds?

I’ve scoured the internet as to why my game starts to lag, and I think I found a reason. Too many collision checks every frame. So that should fix my problem, the only problem is that I don’t know how to do that. Thanks in advance. :slight_smile:

In your Game Properties, I guess if you reduce your max frame rate it would effectively reduce the amount of checks per second, because less frames are being displayed per second

Edit: This is probably a bad idea, I was waiting until my game got to a certain point before adjusting the max frame rate to see how it affects performance. After trying it today, it actually seems to cause more lag.

I’m not sure, but I think when Internet said “too musc collision check”, it didn’t mean it that way.
too much collision checks can also mean: too much event use collision checks and/or too much object are checked per frame, but not all check is necessary in every frame. it can mean your code is unoptimized.
use state machine, sub-events and things, to filtering out unnecessary checks.

Huh, That’s weird. I deleted the light layer and the game is less laggy. Cool.

oh no nevermind it was because there were too many lights with a big radius. Oops

1 Like