docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct EnablePacketLogging

    Add this component to any connection entities (i.e. entities with the NetworkStreamConnection component) to enable detailed netcode packet dump logging.

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

    Packet dumps can be enabled for all connections globally via the Playmode Tools Window. Alternatively, you can add the NetCodeDebugConfig to any sub-scene (via the NetCodeDebugConfigAuthoring) and set the DumpPackets flag to true.

    Properties

    IsPacketCacheCreated

    Check to ensure the packet cache is created, before use.

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

    Methods

    LogToPacket(in FixedString512Bytes)

    Add your own custom logs to Netcode's per-connection packet dump.

    Declaration
    public void LogToPacket(in FixedString512Bytes msg)
    Parameters
    Type Name Description
    FixedString512Bytes msg

    Message to append. Newlines are not automatically added!

    Remarks

    For safety reasons, ensure you fetch this component with write access!

    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)