docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Entities list

    This page contains a list of all entities used by the Netcode package.

    Connection

    A connection entity is created for each network connection. You can think of these entities as your network socket, but they do contain a bit more data and configuration for other Netcode systems.

    Component Description Condition
    NetworkStreamConnection The Unity Transport NetworkConnection used to send and receive data.
    NetworkSnapshotAck Data used to keep track of what data has been received.
    CommandTarget A pointer to the entity where commands should be read from or written too. The target entity must have a ICommandData component on it.
    IncomingRpcDataStreamBuffert A buffer of received RPC commands which will be processed by the RpcSystem. Intended for internal use only.
    IncomingCommandDataStreamBuffer A buffer of received commands which will be processed by a generated CommandReceiveSystem. Intended for internal use only. Server only
    OutgoingCommandDataStreamBuffer A buffer of commands generated be a CommandSendSystem which will be sent to the server. Intended for internal use only. Client only
    IncomingSnapshotDataStreamBuffer A buffer of received snapshots which will be processed by the GhostReceiveSystem. Intended for internal use only. Client only
    OutgoingRpcDataStreamBuffer A buffer of RPC commands which should be sent by the RpcSystem. Intended for internal use only, use an RpcQueue or IRpcCommand component to write RPC data.
    NetworkId The network id is used to uniquely identify a connection. If this component does not exist, the connection process has not yet completed. Added automatically when connection is complete
    NetworkStreamInGame A component used to signal that a connection should send and receive snapshots and commands. Before adding this component, the connection only processes RPCs. Added by game logic to start sending snapshots and commands.
    NetworkStreamRequestDisconnect A component used to signal that the game logic wants to close the connection. Added by game logic to disconnect.
    NetworkStreamSnapshotTargetSize Used to tell the GhostSendSystem on the server to use a non-default packet size for snapshots. Added by game logic to change snapshot packet size.
    GhostConnectionPosition Used by the distance based importance system to scale importance of ghosts based on distance from the player. Added by game logic to specify the position of the player for a connection.
    PrespawnSectionAck Used by the server to track which subscenes the client has loaded. Server only
    EnablePacketLogging Added by game logic to enable packet dumps for a single connection. Only when enabling packet dumps

    Ghost

    A ghost is an entity on the server which is ghosted (replicated) to the clients. It is always instantiated from a ghost prefab and has user defined data in addition to the components listed here which control its behavior.

    Component Description Condition
    Ghost Identifying an entity as a ghost.
    GhostType The type this ghost belongs to.
    GhostCleanup This component exists for only for internal use in the Netcode for Entities package. Used to track despawn of ghosts on the server. Server only
    SharedGhostType A shared component version of the GhostType to make sure different ghost types never share the same chunk.
    SnapshotData A buffer with meta data about the snapshots received from the server. Client only
    SnapshotDataBuffer A buffer with the raw snapshot data received from the server. Client only
    SnapshotDynamicDataBuffer A buffer with the raw snapshot data for buffers received from the server. Client only, ghosts with buffers only
    PredictedGhost Identify predicted ghosts. On the server all ghosts are considered predicted and have this component. Predicted only
    GhostDistancePartition Added to all ghosts with a LocalTransform, when distance based importance is used. Only for distance based importance
    GhostDistancePartitionShared Added to all ghosts with a LocalTransform, when distance based importance is used. Only for distance based importance
    GhostPrefabMetaData The meta data for a ghost, adding during conversion, and used to setup serialization. This is not required on ghost instances, only on prefabs, but it is only removed from pre-spawned right now. Not in pre-spawned
    GhostChildEntity Disable the serialization of this entity because it is part of a ghost group (and therefore will be serialized as part of that group). Only children in ghost groups
    GhostGroup Added to all ghosts which can be the owner of a ghost group. Must be added to the prefab at conversion time. Only ghost group root
    PredictedGhostSpawnRequest This instance is not a ghost received from the server, but a request to predictively spawn a ghost (which the client expects the server to spawn authoritatively, soon). Prefab entity references on clients will have this component added automatically, so anything they spawn themselves will be by default predict spawned.
    GhostOwner Identifies the owner of a ghost, specified as a "Network Id". Optional
    GhostOwnerIsLocal An enableable tag component used to track if a ghost (with an owner) is owned by the local host or not. Optional
    AutoCommandTarget Automatically send all ICommandData if the ghost is owned by the current connection, AutoCommandTarget.Enabled is true, and the ghost is predicted. Optional
    SubSceneGhostComponentHash The hash of all pre-spawned ghosts in a subscene, used for sorting and grouping. This is a shared component. Only pre-spawned
    PreSpawnedGhostIndex Unique index of a pre-spawned ghost within a subscene. Only pre-spawned
    PrespawnGhostBaseline The snapshot data a pre-spawned ghost had in the scene data. Used as a fallback baseline. Only pre-spawned
    GhostPrefabRuntimeStrip Added to prefabs and pre-spawned during conversion to client and server data to trigger runtime stripping of component. Only on prefabs in client and server scenes before they are initialized
    PrespawnSceneExtracted Component present in editor on the scene section entity, when the sub-scene is open for edit. Intended for internal use only. Only in Editor
    PreSerializedGhost Enable pre-serialization for a ghost. Added at conversion time based on ghost settings. Only ghost using pre-serialization
    SwitchPredictionSmoothing Added temporarily when using "Prediction Switching" (i.e. when switching a ghost from predicted to interpolated (or vice-versa), with a transition time to handle transform smoothing. Only ghost in the process of switching prediction mode
    PrefabDebugName Name of the prefab, used for debugging. Only on prefabs when NETCODE_DEBUG is enabled

    Placeholder ghost

    When a ghost is received but is not yet supposed to be spawned the client will create a placeholder to store the data until it is time to spawn it. The placeholder ghosts only exist on clients and have these components

    Component Description Condition
    GhostInstance Identifying an entity as a ghost.
    PendingSpawnPlaceholder Identify the ghost as a placeholder and not a proper ghost.
    SnapshotData A buffer with meta data about the snapshots received from the server. Client only
    SnapshotDataBuffer A buffer with the raw snapshot data received from the server.
    SnapshotDynamicDataBuffer A buffer with the raw snapshot data for buffers received from the server. Ghosts with buffers only

    Client-Only physics proxy

    it is possible to make "physically simulated" ghosts interact with physics objects present only on the client-only physics world (e.g. particles, debris, cosmetic environmental destruction), by spawning kinematic copies of the colliders present on the predicted, simulated ghosts, synced to them. Note, however, that this synchronisation can only go one way. I.e. Client-only physics worlds cannot influence the server authoritative ghost (by definition).

    Component Description
    CustomPhysicsProxyDriver A component that reference the ghost which drive the proxy and let configure how the ghost and the proxy are synced.

    RPC

    RPC entities are created with a send request in order to send RPCs. When they are received, the system will create entities with the RPC component, and a "receive request" (i.e. an ReceiveRpcCommandRequest component).

    Component Description Condition
    IRpcCommand A specific implementation of the IRpcCommand interface.
    SendRpcCommandRequest Specify that this RPC is to be sent (and thus the RPC entity destroyed). Added by game logic, only for sending. Deleted automatically.
    ReceiveRpcCommandRequest Specify that this RPC entity has been received (and thus this RPC entity was recently created). Added automatically, only for receiving. Must be processed and then deleted by game-code, or you'll leak entities into the world. See WarnAboutStaleRpcSystem.

    Netcode RPCs

    Component Description
    ServerApprovedConnection Special RPC only sent on connect.
    RequestProtocolVersionHandshake Special RPC only sent on connect.
    ServerRequestApprovalAfterHandshake Special RPC only sent on connect.
    ClientServerTickRateRefreshRequest Special RPC only sent on connect.
    StartStreamingSceneGhosts Sent from client to server when a subscene has been loaded. Used to instruct the server to start sending prespawned ghosts for that scene.
    StopStreamingSceneGhosts Sent from client to server when a subscene will be unloaded. Used to instruct the server to stop sending prespawned ghosts that live in that scene.

    CommandData

    Every connection which is receiving commands from a client needs to have an entity to hold the command data. This can be a ghost, the connection entity itself or some other entity.

    Component Description Condition
    ICommandData A specific implementation of the ICommandData interface. This can be added to any entity, the connections CommandTarget must point to an entity containing this.
    CommandDataInterpolationDelay Optional component used to access the interpolation delay, in order to implement lag compensation on the server. Also exists on predicted clients, but always has an interpolation delay of 0 there. Added by game logic, predicted only

    SceneSection

    When using pre-spawned ghosts Netcode will add some components to the SceneSection entity containing the ghosts.

    Component Description Condition
    SubSceneWithPrespawnGhosts Added during conversion to track which section contains pre-spawned ghosts.
    SubSceneWithGhostCleanup Used to track unloading of scenes. Processed sections.
    PrespawnsSceneInitialized Tag to specify that a section has been processed. Processed sections.
    SubScenePrespawnBaselineResolved Tag to specify that a section has resolved baselines. This is a partially initialized state. Partially processed sections.

    Netcode created singletons

    PredictedGhostSpawnList

    A singleton with a list of all predicted spawned ghosts which are waiting for a ghost from the server. This is needed when writing logic matching an incoming ghost with a pre-spawned one.

    Component Description
    PredictedGhostSpawnList A tag for finding the predicted spawn list.
    PredictedGhostSpawn A lis of all predictively spawned ghosts.

    Ghost Collection

    Component Description
    GhostCollection Identify the singleton containing ghost prefabs.
    GhostCollectionPrefab A list of all ghost prefabs which can be instantiated.
    GhostCollectionPrefabSerializer A list of serializers for all ghost prefabs. The index in this list is identical to GhostCollectionPrefab, but it can temporarily have fewer entries when a prefab is loading. This references a range in the GhostCollectionComponentIndex list.
    GhostCollectionComponentType The set of serializers in the GhostComponentSerializer.State which can be used for a given type. This is used internally to setup the GhostCollectionPrefabSerializer.
    GhostCollectionComponentIndex A list of mappings from prefab serializer index to a child entity index and a GhostComponentSerializer.State index. This mapping is there to avoid having to duplicate the full serialization state for each prefab using the same component.
    GhostComponentSerializer.State Serialization state - including function pointers for serialization - for a component type and variant. There can be more than one entry for a given component type if there are serialization variants.

    Spawn queue

    Component Description
    GhostSpawnQueueComponent Identifier for the ghost spawn queue.
    GhostSpawnBuffer A list of ghosts in the spawn queue. This queue is written by the GhostReceiveSystem and read by the GhostSpawnSystem. A classification system running between those two can change the type of ghost to spawn and match incoming ghosts with pre-spawned ghosts.
    SnapshotDataBuffer Raw snapshot data for the new ghosts in the GhostSpawnBuffer.

    NetworkProtocolVersion

    Component Description
    NetworkProtocolVersion The network protocol version for RPCs, ghost component serializers, netcode version and game version. At connection time netcode will validate that the client and server has the same version.

    PrespawnGhostIdAllocator

    Component Description
    PrespawnGhostIdRange The set of ghost ids associated with a subscene. Used by the server to map prespawned ghosts for a subscene to proper ghost ids.

    PrespawnSceneLoaded

    This singleton is a special kind of ghost without a prefab asset.

    Component Description
    PrespawnSceneLoaded The set of scenes with pre-spawned ghosts loaded by the server. This is ghosted to clients.

    MigrationTicket

    Component Description
    MigrationTicket Created in the new world when using world migration, triggers the restore part of migration.

    SmoothingAction

    Component Description
    SmoothingAction Singleton created when a smothing action is registered in order to enable the smoothing system.

    NetworkTimeSystemData

    Component Description
    NetworkTimeSystemData Internal singleton, used to store the state of the network time system.
    NetworkTimeSystemStats Internal singleton, that track the time scaling applied to the predicted and interpolated tick.
    Used to report stats to net debugger.

    NetworkTime

    Component Description
    NetworkTime Singleton component that contains all the timing characterist of the client/server simulation loop.

    NetDebug

    Component Description
    NetDebug Singleton that can be used for debug log and managing the logging level. Like the built-in UnityEngine logging, this works even in production builds.

    NetworkStreamDriver

    Component Description
    NetworkStreamDriver Singleton that can hold a reference to the NetworkDriverStore and that should be used to easily listening for new connection or connecting to server.

    RpcCollection

    GhostPredictionSmoothing

    Component Description
    GhostPredictionSmoothing Singleton used to register the smoothing action used to correct the prediction errors.

    GhostPredictionHistoryState

    Component Description
    GhostPredictionHistoryState Internal singleton that contains the last predicted full tick state of all predicted ghost

    GhostSnapshotLastBackupTick

    Component Description
    GhostSnapshotLastBackupTick Internal singleton that contains the last full tick for which a snapshot backup is avaiable. Only present on the client world.

    GhostStats

    Component Description
    GhostStats State if the Network Debugger tools is connected or not.
    GhostStatsCollectionCommand Internal stats data for commands.
    GhostStatsCollectionSnapshot Internal stats data used to track sent/received snapshot data.
    GhostStatsCollectionPredictionError Record the prediction stats for various ghost/component types pair.
    GhostStatsCollectionMinMaxTick
    GhostStatsCollectionData> Contains internal data pools and other stats system related states.

    GhostSendSystemData

    Component Description
    GhostSendSystemData Singleton entity that contains all the tweakable settings for the GhostSendSystem

    SpawnedGhostEntityMap

    Component Description
    SpawnedGhostEntityMap Singleton that contains the last predicted full tick state of all predicted ghost

    User create singletons (settings)

    ClientServerTickRate

    Component Description
    ClientServerTickRate The tick rate settings for the server. Automatically sent and set on the client based on the values specified on the server.

    ClientTickRate

    Component Description
    ClientTickRate The tick rate settings for the client which are not controlled by the server (interpolation time etc.). Use the defaults from NetworkTimeSystem.DefaultClientTickRate instead of default values.

    LagCompensationConfig

    Component Description
    LagCompensationConfig Configuration for the PhysicsWorldHistory system which is used to implement lag compensation on the server. If the singleton does not exist PhysicsWorldHistory will no be run.

    GameProtocolVersion

    Component Description
    GameProtocolVersion The game specific version to use for protcol validation on connection. If this does not exist 0 will be used, but the protocol will still validate netcode version, ghost components and rpcs

    GhostImportance

    Component Description
    GhostImportance Singleton component used to control importance settings.

    GhostDistanceData

    Component Description
    GhostDistanceData Settings for distance based importance. If the singleton does not exist distance based importance is not used.

    Predicted Physics

    Component Description
    PredictedPhysicsNonGhostWorld Singleton component that declare which physics world to use for simulating the client-only physics entities.

    NetCodeDebugConfig

    Component Description
    NetCodeDebugConfig Create a singleton with this to configure log level and packet dump for all connections. See EnabledPacketLogging on the connection for enabling packet dumps for a subset of the connections.

    DisableAutomaticPrespawnSectionReporting

    Component Description
    DisableAutomaticPrespawnSectionReporting Disable the automatic tracking of which sub-scenes the client has loaded. When creating this singleton you must implement custom logic to make sure the server does not send pre-spawned ghosts which the client has not loaded.
    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)