Game lags? Always check your game instances in debugger mode

Soooo I just want to share something that I just learned. Since I am new here and other newbies like me may find it useful

I was wondering why my game was lagging so much after implementing a skin system.

Till I checked debugger mode

This was happening because I had the below event

Gdevelop was creating non-stop instances.

So I added the trigger once event to stop it from doing so.

Trigger once can really be your best friend :laughing:

Lol, how to kill your computer



Instead of using a global you should use an object variable for the mosnters so later in a foreach you do

Foreach MonsterSkins
if MonsterSkins.Variable(SkinSelected) == 0
→ Actions
—> Among objects MonsterSkins…
—> MonsterSnins.Variable(SkinSelected) = 1

This way you check only for all MonsterSkin then change the skin you want.

1 Like

Hey there, thanks for the tip!

Actually this is the events that I am using for the skins.

Hi you can remove Always this does nothing at this moment.

I think putting a condition there prevents the compiler from getting confused and avoids errors.

Like with any other engine, be methodical and treat any sort of performance save as gold. Be EXTRA careful and stingy with your frames and it pays off in the long run.