Persisting NetworkObjects
This page will go over details on the options available to users for persisting NetworkObjects across scene loading and unloading
Last updated
This page will go over details on the options available to users for persisting NetworkObjects across scene loading and unloading
Last updated
The options available to users to keep NetworkObjects persisting across scenes depends on the type of NetworkObject.
that do not fall into the other categories below can persist between scenes by moving them while loading into the next scene. The that is passed into the Load Method of the SceneManager has an array that you can populate with all of the Spawned NetworkObjects you want to send to the new loaded scene.
The SceneManager will handle the objects correctly for you and also flag a Debug if you try to send a GameObject that is not allowed.
If you load Multiple Scenes in one method call, and you are moving network objects using SceneLoadData. The moved networkobjects will move into the first valid scene requested.
To make a NetworkObject global just mark the IsGlobal Boolean "true" on the NetworkObject component.
currently cannot persist across scenes, it is a with the way Unity and Fishnet was designed. You can not mark them as Global, or put them into "DontDestroyOnLoad" scene. If you would like a Scene NetworkObject to persist across scenes it is recommended to remove them and use the other options available on this page.
G work similar to how a normal GameObject would when put into the "DontDestroyOnLoad"(DDOL) scene. When loading and unloading scenes, Global NetworkObjects will stay in the (DDOL) scene on both the server and client persisting their state. No extra steps needed.
Unity will not allow to be moved into other scenes. However! Fishnet will automatically detect if you are trying to send a NestedNetworkObject and send the root of the object instead!