docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    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 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 (in ticks) reported for this entity. The delay value is updated every time the target entity receives a command from the client, as this interpolation delay is included in the command header. If the client switches its CommandTarget (for example: by entering a vehicle), by either changing the CommandTarget or by enabling another AutoCommandTarget, the value of the delay becomes stale. In other words: It is never reset to 0, and will remain the same as reported by the last received command.

    Declaration
    public uint Delay
    Field Value
    Type Description
    uint

    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)