docs.unity.cn
    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.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    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
    Int32
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023