I am making a 3D platformer game, where you have to collect pink stars.
Once the player touches one - an AnimationPlayer is triggered to among other things start two particle systems, play some animations on two meshes and change energy of an Omni Light. Then the animation triggers a queue_free() call after 12 seconds when the particles are gone.
Here's how the game looks and works:
https://youtu.be/3PnZJJPJqtQ
I've noticed that the first time I trigger this during a run the game hangs for the longest period right before showing the particles, and the consecutive times usually are faster or even almost glitch-free.
The smoke particles probably take up the most resources, because they use a 2K texture (Albedo + Normal Map) with 4x4 tiles - each smoke particle uses a random tile to produce more natural image.
They also receive shadows and there's some hue variation.
I see that even without the initial stutter the smoke effect is too heavy. I will be looking into ways to optimize it, but now I want to find a way to fix this initial stutter.
How can I debug and fix such a problem in Godot 3?