Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[SOLVED]LoadSceneAsync Additive with Unet

Discussion in 'UNet' started by lloydhooson, May 9, 2016.

  1. lloydhooson

    lloydhooson

    Joined:
    Apr 7, 2008
    Posts:
    77
    Hi, I'm working on a project that has a host that other players need to connect to. Currently it uses additive async loading as I am using the multiple scene editing feature for splitting up the scenes. However I cannot get any network behaviors saved to a scene other than on the host to activate correctly. I have a network behavior spawned at run time to send general data across such as telling the client which scene to load, this works. The client network identity's are always disabled the host seem to be working (when sending RPCs from the server to the client on the host - they work).

    The I get the error on a proper (non host) client is:
    Spawn scene object not found for 1

    What am I missing here, There seems to level loading in the network manager however that's block dump loading, which is not desirable and ugly.

    Any help much appreciated. Thanks.
     
  2. lloydhooson

    lloydhooson

    Joined:
    Apr 7, 2008
    Posts:
    77
    Hi after a couple more days of looking into this it seems that there is no usable solution from Unity, therefore the actual solution come in the form of using third party networking.

    Beggars belief that key features of an engine are not supported if using other features of the same engine, and a compatibility chart is not documented anywhere.

    Buy TNet: https://www.assetstore.unity3d.com/en/#!/content/56798

    Save yourself hassle.
     
  3. GroenBoer

    GroenBoer

    Joined:
    Nov 30, 2014
    Posts:
    46
    You need to make sure that the network objects from the secondary/loaded scenes are added to the network prefab spawn list.
     
  4. crydrk

    crydrk

    Joined:
    Feb 10, 2012
    Posts:
    74
    I'm having this problem as described in the original post. However, it's happening with objects with NetworkBehaviors that are simply sitting in that scene, not getting spawned.

    Is the only solution in my case to turn those objects into prefabs and specifically network spawn them? Or could I turn them into prefabs, leave them in their scene, and simply add those prefabs to the network prefab spawn list?

    My second question is that these same network behaviors work fine in my main scene if I move them out of the additive scene. Whats the difference between these two situations? Just the fact that it didn't exist yet when the connection was made, necessitating a spawn?

    I could try this myself, but I won't have access to the project again until Monday and am excited for this possible solution.
     
  5. Juruhn

    Juruhn

    Joined:
    Jun 25, 2013
    Posts:
    13
    Got the same issue and resolved it by moving my networkmanager and the script which does the scene loading to the main scene. When I additionally load a scene now with 50 objects with networkIdentities, it just works and no errors.
    The scene object '1' was in my case the networkID for the script which loads the scenes and is networkbehaviour.