Core components
Learn about the three core components of Netcode for GameObjects: NetworkObject, NetworkBehaviour, and NetworkManager.
- NetworkObject: This component, added to a GameObject, declares a prefab or in-scene placed object as a networked object that can have states synchronized between clients and/or a server. A NetworkObject component allows you to identify each uniquely spawned instance (dynamically or in-scene placed). You cannot derive from the NetworkObject component class.
- NetworkBehaviour: This is the fundamental networked scripting component that allows you to synchronize state and write netcode script(s). You derive from this class to create your own netcode component scripts.
- NetworkManager: This component is the overall network session configuration and session management component. A NetworkManager component is necessary to start or join a network session.
NetworkObject
NetworkBehaviour
| Topic |
Description |
| NetworkBehaviour |
NetworkBehaviour is an abstract class that derives from MonoBehaviour and is primarily used to create unique netcode or game logic. To replicate any netcode-aware properties or send and receive RPCs, a GameObject must have a NetworkObject component and at least one NetworkBehaviour component. |
| Synchronizing |
Understand a NetworkBehaviour component's order of operations when it comes to spawning, despawning, and adding custom synchronization data. |
NetworkManager
| Topic |
Description |
| NetworkManager |
The NetworkManager component is a required Netcode for GameObjects component that has all of your project's netcode-related settings. Think of it as the central netcode hub for your netcode-enabled project. |
| Player prefabs and spawning players |
Learn about spawning player objects and creating player prefabs. |
Additional resources