Forum rules - please read before posting.

Loading scenes on web player

Is there a way to show a progress bar to show up when loading from one scene to the next on the web player? I have one small intro scene and the a big scene to play. When I test them on the web it goes black when changing from the "light" scene to the "heavy"scene.
I don´t know if I followed the instructions correctly, but I created a separated loading scene as the manual suggested, checked the option for loading scene and didn´t work. It just goes black forever when tested online. When tested offline there´s no problem.


  • I don't think a progress bar would be possible, but you're reporting a bug here, which is the bigger concern.  So offline (editor / standalone?) it works, and the loading screen shows up, but in webplayer it just hangs?
  • Yes it just hangs. I´m making more tests. So give me some time to report further details on the issue.
  • edited February 2015
    Ok the following thing were done to achieve this:
    1- A title scene with a main menu and a new game button, following the instructions of the AC tutorials.
    2- A big game scene of approx 60mb with a lot of NPC's, a big terrain and other features.
    3- A loading scene with just a camera, a directional light and a texture positioned in front of the camera.
    4- When the new game button is pressed an action list runs that turns off the menu and changes the scene to the big scene. But the use loading screen box is checked and the loading scene number placed.

    Result: a black screen that goes forever when changing to the big scene.
    I don´t know if I´m missing something or if this happens because is a bug?
    I also tried placing an Application.LoadLevelAsync and Application.LoadLevelAdditiveAsync in the loading scene and specify the scene to load within those scripts and didn't work either?

  • I've tested loading screens in webplayer, and it ran fine.  It's not clear if this is occuring because of the loading scene, or the large scene that comes after.  If you remove the loading scene, and just go straight to the large scene, does it then work?

    Also, when you say you tested offline, did you mean in editor, or standalone?
  • edited February 2015
    I´ve tested the big scene alone and it works perfect also tested all other scenes alone and runs smoothly.
    With all the other hundreds of tests have been one with the streamed build from the desktop there´s no problem. The thing use to happen when tested in the server only. Because offline(streamed build) the loading screen did´t even appear.
    Now I don´t have a clue what´s happening. Whenever a check in the loading scene in the settings and put the corresponding name or number there, the game just fades to black forever when changing from the title scene to the next.
    The loading scene in this case is not an AC scene (but it was with the same results). It´s just a camera, a light and a sprite texture as the manual suggests. I really don't know what else could it be. Also tried with the CanStreamedLevelBeLoaded function and the Application.GetStreamProgressForLevel. But no positive results whatsoever. No matter the script or the variation, the game always stays in that black limbo forever when calling the loading scene.

    When tested in editor this is what I get:
    NullReferenceException: Object reference not set to an instance of an object
    AC.SceneChanger.LoadLevel (System.String sceneName, Int32 sceneNumber, Boolean useLoadingScreen) (at Assets/AdventureCreator/Scripts/Game engine/SceneChanger.cs:105)
    AC.SceneChanger.ChangeScene (System.String sceneName, Int32 sceneNumber, Boolean saveRoomData) (at Assets/AdventureCreator/Scripts/Game engine/SceneChanger.cs:68)
    AC.ActionScene.ChangeScene () (at Assets/AdventureCreator/Scripts/Actions/ActionScene.cs:75)
    AC.ActionScene.Run () (at Assets/AdventureCreator/Scripts/Actions/ActionScene.cs:44)
    AC.ActionList+<RunAction>c__Iterator1.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:206)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:172)
    AC.ActionList:ProcessActionEnd(ActionEnd, Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:313)
    AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:263)
    AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:242)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:172)
    AC.ActionList:BeginActionList(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:150)
    AC.ActionList:Interact(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:113)
    AC.RuntimeActionList:DownloadActions(ActionListAsset, Conversation, Int32, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/RuntimeActionList.cs:76)
    AC.AdvGame:RunActionListAsset(ActionListAsset, Conversation, Int32, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:106)
    AC.AdvGame:RunActionListAsset(ActionListAsset) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:72)
    AC.MenuButton:ProcessClick(Menu, Int32, MouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuButton.cs:413)
    AC.PlayerMenus:CheckClick(Menu, MenuElement, Int32, MouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1252)
    AC.PlayerMenus:CheckClicks(Menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1065)
    AC.PlayerMenus:UpdateAllMenus() (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1173)
    AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:152)

  • Another update:
    I´ve tested loading small scenes taht have only a camera and a cube infront of it and the same problem persists. If test the streamed build offline by opening the HTML everything works fine. If I test the thing on a server using a web adress the scene goes black forever.
    If I test any scene, no matter the size, by itself, works perfectly.
  • Going by your Console logs, it looks like there's a bug related to using loading scenes if you don't have a player prefab assigned.  Is that the case with your game?  If so, try adding a temporary player prefab (you can use the ones in either of the demo games) to the Settings Manager.  If it works, we know the cause of the problem and I'll have it fixed for the next update.
  • Yes you´re right on the spot. I placed a new player prefab on those scenes and the loading screen now works. But yet again, this is an offline behavor only. I'm still trying to undestand what is avoiding loading from one scene to the other when tested on a server. I'm really in the dark on this subject. It's always the same thing. When changing to the next scene it blacks out forever. I´ve gone through, all the known scripts like the "Application Async" loading scripts, theCanStreamedLevelBeLoaded function and the Application.GetStreamProgressForLevel. Now I'm making tests Downloading AssetBundles at runtime and is not working either. The weird thing is that all those scripts work perfectly offline. They show the loading porcentage and a loading bar and everything.... I'm clueless...
  • If other tests like assetbundles aren't working for you either, it sounds like there's a more fundamental problem with your project, and not necessarily an AC one.  I'd start with a new project and just look at getting AssetBundles to work again - you may need to go to the Unity forums - but once you've gotten that working (i.e. something that wasn't working before) then you can start to look at why it's not working in your main project.
  • edited March 2015
    Thank´s Chris as always. I´m already on that. No luck so far but I´ll keep updating in case I found a solution because some people could find the asset bundle and other topics discussed here very confusing but yet importat in Unity´s learning curve.
  • ivan, did you ever get your loading screen in Webplayer issue resolved? If so, what was the solution?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.