docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Field ActiveSceneSynchronization

    When set to true and the active scene is changed, this will automatically migrate the NetworkObject into the new active scene on both the server and client instances.

    Namespace: Unity.Netcode
    Assembly: solution.dll
    Syntax
    public bool ActiveSceneSynchronization
    Returns
    Type Description
    bool
    Remarks
    • This only applies to dynamically spawned NetworkObjects.
    • This only works when using integrated scene management (NetworkSceneManager).

    If there are more than one scenes loaded and the currently active scene is unloaded, then typically the SceneManager will automatically assign a new active scene. Similar to DestroyWithScene being set to false, this prevents any NetworkObject from being destroyed with the unloaded active scene by migrating it into the automatically assigned active scene. Additionally, this is can be useful in some seamless scene streaming implementations. Note: Only having ActiveSceneSynchronization set to true will not synchronize clients when changing a NetworkObject's scene via MoveGameObjectToScene. To synchronize clients of a NetworkObject's scene being changed via MoveGameObjectToScene, make sure SceneMigrationSynchronization is enabled (it is by default).

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)