Hello,
Pre Unity 2020.1, we were able to load a Unity WebGL game but not actually start it until clicking another button on our page, using noInitialRun: true
and onRuntimeInitialized
, along with gameInstance.Module.callMain();
Is this still possible with the new way Unity loads WebGL games? Now we have createUnityInstance() with a .then() promise, but it seems like by the time we callback to then() the game is already running. Ideally we’d like to load the game as soon as the user enters the page, but then have a button to actually start the game (and unlock the audio.)
Thanks
I start off with my unityContent div that holds the Unity player set to style="display: none
The game loads normally but you can’t see anything because it’s hidden.
Once the preroll ad completes the unityContent div gets set to style="display: inline
Ghetto but it works
Yeah, I did actually implement this. It kinda works, but then you miss the splash screen playing. Do you think it’s possible to pause the game before the flash screen? If I could run a script before the flash screen I guess I could call out to javascript and ask if my start button has been pressed yet to continue. Otherwise worst case I could roll my own flash screen or something.
Would still be nice to know if the original functionality is actually gone from Unity. Thanks though for the idea!
1 Like