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
Inherited Members
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 |