docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct InputEvent

    This type can be used inside IInputComponentData to store input events.

    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 InputEvent
    Remarks

    When this type is used it's ensured that single input events like jumping or triggers will be properly detected exactly once by the server.

    Fields

    Count

    Track if the event has been set for the current frame.

    Declaration
    public uint Count
    Field Value
    Type Description
    uint
    Remarks

    This could be higher than 1 when the inputs are sampled multiple times before the input is sent to the server. Also if the input is sampled again before being transmitted the set event will not be overridden to the unset state (count=0).

    Properties

    IsSet

    Returns true when a new input event was detected (last known tick this was unset).

    Declaration
    public bool IsSet { get; }
    Property Value
    Type Description
    bool

    Methods

    Set()

    Set or enable the input event for current tick.

    Declaration
    public void Set()

    ToFixedString()

    Helper.

    Declaration
    public FixedString32Bytes ToFixedString()
    Returns
    Type Description
    FixedString32Bytes

    'InputEvent[Count]'

    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)