docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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

    Topic Description
    NetworkObject A NetworkObject is a GameObject with a NetworkObject component and at least one NetworkBehaviour component, which enables the GameObject to respond to and interact with netcode.
    NetworkObject parenting Understand how NetworkObjects are parented in Netcode for GameObjects.

    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

    • GameObjects
    In This Article
    Back to top
    Copyright © 2025 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)