docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct GhostOwner

    The GhostOwnerComponent is an optional component that can be added to a ghost to create a bond/relationship in between an entity and a specific client (for example, the client who spawned that entity, a bullet, the player entity). It is usually added to predicted ghost (see PredictedGhost) but can also be present on the interpolated ones.

    It is mandatory to add a GhostOwner in the following cases:

    - When a ghost is configured to be owner-predicted GhostMode, because it is necessary to distinguish in between who is predicting (the owner) and who is interpolating the ghost.

    - If you want to enable remote player prediction (see ICommandData) or, in general, to allow sending data based on ownership the SendToOwner.

    - If you want to use the AutoCommandTarget feature.

    Implements
    IComponentData
    IQueryTypeParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public struct GhostOwner : IComponentData, IQueryTypeParameter

    Fields

    NetworkId

    The NetworkId of the client the entity is associated with.

    Declaration
    public int NetworkId
    Field Value
    Type Description
    int

    Implements

    Unity.Entities.IComponentData
    Unity.Entities.IQueryTypeParameter
    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)