Struct CommandDataInterpolationDelay
Optional component used to access the interpolation delay in order to implement lag compensation on the server. Also exists on predicted clients (but the interpolation delay will always be 0).
The component is not baked during conversion by default, and should be added explicitly by the user at one of two points:
1. At conversion time: By using the checkbox in GhostAuthoringComponent
or your own Baker.
2. At runtime: After the entity is spawned.
Inherited Members
Namespace: Unity.NetCode
Syntax
public struct CommandDataInterpolationDelay : IComponentData, IQueryTypeParameter
Remarks
When the component is present on a ghost, the CommandReceiveSystem<TCommandDataSerializer, TCommandData>.ReceiveJobData will automatically update the Delay value with the latest reported interpolation delay from this connection (i.e. the connection that is sending the command for this entity). As such, the component is updated only for entities that are predicted, and that have at least one input command buffer.
Fields
Delay
The latest reported interpolation delay reported for this entity. The delay value is update every time the target entity receive commands. If the client switch target for commands (ex: enter a vehicle), by either changing the CommandTarget or by enabling another AutoCommandTarget, the value of the delay become stale: is never reset to 0 and will remain the same as repoted by the last command.
Declaration
public uint Delay
Field Value
Type | Description |
---|---|
UInt32 |