NetworkObject
This component is attached automatically anytime a script which inherits from NetworkBehaviour is added to your object.
Description
The NetworkObject component is essential for any game object that needs to be synchronized or controlled over the network using FishNet. It acts as the anchor for all networked behaviors and manages identification, ownership, and the object's lifecycle within the networking system.
You can nest network objects, place them in scenes, or in prefabs, but the component itself cannot be added to a game object at run-time.
Check out the API page for more specific methods, properties, and events here.
Settings

⚙️ Is Networked
Indicates if an object should always be considered a networked object. When false the object will not initialize as networked. This may be useful if you have objects that you sometimes want to only run locally, and other times spawn over the network. Anytime an object is spawned using ServerManager.Spawn Is Networked automatically becomes true for that instantiated copy.
⚙️ Is Spawnable
This should be enabled if the object can spawn at runtime; this is generally false for scene prefabs as you do not need to instantiate and manually spawn them. While true, this object's prefab will be added to DefaultPrefabObjects.
⚙️ Is Global
When enabled, this will make the NetworkObject known to all clients at all times, the object will also be added to the Don't Destroy on Load scene. This setting will have no effect on scene objects, but for instantiated objects it may be set in the prefab or changed at run-time immediately after instantiating the object.
⚙️ Initialize Order
Determines the order in which NetworkObjects spawned in the same tick will run their initialization callbacks. A lower value will have higher priority and execute first. The default value is 0 and negative values are allowed.
⚙️ Prevent Despawn On Disconnect
This will ensure the object will not be destroyed or despawned when the owning client disconnects.
⚙️ Default Despawn Type
This is the default behavior when despawning the object. Objects are typically destroyed when despawned, but this can be set to other values, such as Pool, to save performance.
Check out the Object Poolingguide for more information.
Last updated