Search Unity

Working with Scene Objects when not connected

Discussion in 'Multiplayer' started by jashan, Apr 5, 2016.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    In our game, players basically do everything in a single scene, including connecting and disconnecting to the network.

    This works just fine with networked objects that are instantiated during runtime but I'm running into some issues with scene objects (objects from the scene that should nevertheless be synchronized).

    In the documentation it says that such objects are disabled when the scene is loaded and enabled when the connection is established (or when NetworkServer.SpawnObjects() is manually called).

    What is the best way to deal with a situation where I need those objects even when the player is offline? Basically, I'm doing any synchronisation that's necessary myself once the player is online (server overrides any client state) and would like to use NetworkIdentity to find my objects.

    Can that be done or do I have to implement my own object lookup (and avoid scene objects with NetworkIdentity altogether)?