- Home /
WebGL build crashes but game runs fine in editor and windows build.
The game runs fine in the editor as well as when built for windows. When I build for webGL I get those errors and the game stops functioning. I'm 99% sure that the webGL build simply won't open my asset bundle for some reason. The asset bundles are built for webgl (I have another set for windows) and I've verified countless times that the file path is absolutely correct (verified by the fact that the paths work perfectly fine in windows build). It doesn't matter if I strip engine code or not. The only way I can get the game to function is with full exception handling. That's just keeping it from crashing though, the assets in my asset bundle never actually appear in game. This problem has been plaguing me for months now. If someone could help me solve this, that'd just be wonderful.
I hope that bumping after several days isn't frowned upon. This is still an active problem without any solution and I'd still appreciate a hand.
(I'm not a WebGL expert, but I'll have a stab) Your log suggests that you're trying to load a bundle at file:///C:/Users/oxrock/Desktop/QU_webgl/Strea$$anonymous$$gAssets/webgl_spritesbundle. I assume that's the strea$$anonymous$$g assets directory of the project in which you're working? (i.e. we're talking about an assetbundle shipped with the project, rather than a patch). I'm somewhat surprised that WebGL is trying to use the file:// protocol as I would have thought this would have been sandboxed by the browser - what exactly is the path you're providing to WWW.LoadFromCacheOrDownload() ? Also, I vaguely remember that method is case-sensitive, so make sure your bundle is exactly called that.
this is my bundle loading function:
void loadSprites()
{
string filePath = Application.strea$$anonymous$$gAssetsPath + "/webgl_spritesbundle";
sprites = AssetBundle.LoadFromFile(filePath);
}
And you're correct, the bundle is not meant to be downloaded after. It's simply part of the project.