I’m trying to build my project for WebGL and I’m having a lot of issues. It currently runs at less than 10 FPS in the build. I click Build and Run and open the profiler for the project to see what’s going on, and 98% of the CPU is being dedicated to “WaitForTargetFPS.”
There’s a ton of empty space below it because the actual code only takes about 5ms per frame. I don’t know why WaitForTargetFPS could be eating up so much.
VSync is disabled in Quality settings for every quality level, and there are no references to
Application.targetFrameRate in any of my scripts, so I have no idea why processing power still seems to be spent on VSync.
Some have said it’s because my game takes too long to render frames, but I don’t think that’s the case. I get hundreds of FPS in the editor and no WaitForTargetFPS but only up to 10 in the WebGL build. It also works fine when I build to other platforms.
It’s a really simple platformer game with just some sprites, and even changing the max texture size to 64 doesn’t affect performance, so I think that’s not the issue.