I load all the assets for the build in a loading scene, however where most of the game runs fine, instantiating this packed scene always makes the game freeze <@&1349109171240439858>, additionally I'm using load() instead of preload() here is the code I used for instancing
#Noticeable stutter / freeze when instantiating packed scene on Web build
1 messages · Page 1 of 1 (latest)
I think it has to do with on-demand shader compilation. One solution (I haven't tried) is this: At the game start create a sort of preloading scene (all black maybe) that instantiates the troublesome scene(s) and adds it (them) to the tree with scale 0 or something. Make sure you emit the particles or whatever for 1+ frames or so. Then queue_free the stuff. Now when you move on to the real game the stutter won't happen.
I actually do this, here's what I did
the stutter seems to come from genuinely instantiating the object for some reason
also I will note, this isnt doing anything, it still lags all the same for some reason
Have you tried instantiating this scene only once at the beginning of the game and then keeping it somewhere in a disabled, invisible state, and then just making it appear and apply the right impulse and whatnot? Just to gain a bit more insight.
I wanted to find ways to make it run smoother without pooling, but I will definitely implement it soon