Random Idle time spikes, no script functions spike. How do i fix it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FelipeBdC

I’m making a simple top-down shooter inspired by Enter the Gungeon, but when i run the game i get these annoying idle time spikes. I tried checking the script functions category but the frametime is really low there, and i don’t understand what’s causing the idle time to be this unstable!

Idle Time Spikes(With Script Functions being shown)
Idle Time Spikes(With Frame-time tab being shown)

Are you preload()ing your bullets before instance()ing them? Are you queue_free()ing your bullets once they exit the screen?

timothybrentwood | 2021-05-07 15:49

Can you reproduce lag spikes if you run the project after exporting it, while the editor is closed? Alternatively, you can use the Run button in the Project Manager to test this.

Calinou | 2021-05-08 00:57