2D game framerate drop with additionally loaded scenes

Hallo everyone!

I started on a 2D project where a character with respective sprite animations moves on a grid. When everything is in a single scene this works fine and the movement is smooth, but when I split the setup into an initial scene (with some global managers for the game) and a scene with the actual level that is loaded additionally, the framerats drastically drops in the WebGL build (it still runs smoothly in the Unity editor). The code for the pathfinding and movement stays the same, so it seems to have to do with the scene split.

Are there any WebGL specific points to look out for when making a WebGL build that loads several scenes additionally that could impact the performance?

Any hints and tipps for this issue would be greatly appreciated.

Thanks in advance and best regards,
Patrick

Do both scenes have cameras? Also check you don’t have two listeners (on multi cameras) as it creates debug spam. Check the stats and profile to see where the slow down is happening.

Hello @NicBischoff !

Thanks for your tipps! I will look into profiling the build as soon as I can. The camera in the starting scene is deactivated as soon as the additional level is loaded, and there is only one listener present. Could there be anything else causing problems, or is deactivating the camera maybe not enough?

Best regards,
Patrick