docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct LocalConnection

    Used to mark your local NetworkConnection entity. Useful on a single world host (where you typically have multiple NetworkConnection and player entities for other connected clients). This will always be present client side, never present on a server only world, and present on only one connection in a single world client-hosted server world.

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

    On a single world host, an alternative for finding the local connection is to query for entities WithAll NetworkId and WithNone NetworkStreamConnection. However, LocalConnection is more explicit.

    Implements

    IComponentData
    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)