Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.09k
stars
429
forks
source link
2.0.0-exp2 Distributed Authority has some undue GC every frame #2891
Description
In NGO 2.0.0-exp2, simply enabling "distributed authority" in the network manager's session mode results in garbage allocation every frame.
The issue occurs under
NetworkSpawnManager.DeferredDespawnUpdate
, due to closure ofcurrentTick
near the end of the method.Reproduce Steps
Actual Outcome
GC per frame with distributed authority is 20
Expected Outcome
GC per frame with distributed authority is 0
Environment
Fixing this
Change the following code from this:
To this: