docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct AutoCommandTarget

    Component that automates command "reading and sending" (for clients) or "writing, using, and broadcasting" (for the server).

    When the AutoCommandTarget component is Enabled, the entity is considered as an input source for ICommandData's for the client and all non empty command buffers present on the entity are serialized into the OutgoingCommandDataStreamBuffer, along with the id of the ghost they are sent to.

    On the server side, when a command is deserialized from the IncomingCommandDataStreamBuffer, the corresponding entity is looked up, and if the AutoCommandTarget component is enabled, the commands are added to the corresponding input command buffer.

    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 AutoCommandTarget : IComponentData, IQueryTypeParameter
    Remarks

    To use the AutoCommandTarget, the target entity must have a GhostOwner.

    Fields

    Enabled

    Enabled/Disable the current entity from sending and receiving commands. Multiple entities can be enabled at the same time.

    Declaration
    public bool Enabled
    Field Value
    Type Description
    bool

    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)