Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved "Adding NetworkVariable {name}" spam on object selection

Discussion in 'Netcode for GameObjects' started by LaneFox, May 1, 2023.

  1. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Why does NGO log this every time I select a gameobject with a NetworkBehavior component? This does not seem useful and I don't see anything I've done that would be causing this as the classes are very simple.

    When is it expected to log this out and why do I always see it?

    Code (csharp):
    1. // Logs for this variable every time.
    2. public class NetworkedStateObject : NetworkBehaviour
    3. {
    4.     public NetworkVariable<int> StateObjectId = new NetworkVariable<int>();
    5. }
    Code (csharp):
    1. // Logs for the base class and these variables every time.
    2. public class Pointer : NetworkedStateObject
    3. {
    4.     public NetworkVariable<Vector3> EndPoint;
    5.     public NetworkVariable<bool> IsOn;
    6. }
    Adding NetworkVariable StateObjectId

    Adding NetworkVariable EndPoint

    Adding NetworkVariable IsOn
     
  2. NoelStephens_Unity

    NoelStephens_Unity

    Unity Technologies

    Joined:
    Feb 12, 2022
    Posts:
    252
    LaneFox,
    That looks like a debug log that wasn't removed for PR-2364 and should be removed.
    Created PR-2562 to remove this in the next patch.
     
    LaneFox likes this.