cancel
Showing results for 
Search instead for 
Did you mean: 

FYI - Memory Leak in Network Animator

ProfessorTroy
Adventurer
Hey Fellow Devs;

Been profiling memory, draw calls and etc. After eliminating/hitting most of my bigger leaks, I noticed a pretty constant leak coming from the Network Animator object. Now, if you are making a network game, this is kind of important, because it *will* eventually trigger a GC that'll definitely give you a FPS hiccup. It's only ~2-4K every few frames, but it adds up over a minute or two.

Anyway, given that there are other known issues with Network Animator, I've basically trashed it from my project.

Best work around for keeping animations "in sync" with each other is to do the following:

1. Create a SyncVar(hook="InputUpdatedX") for both your X/Y inputs for movement if you have any animations tied to these.
2. Create a "RpcTriggerSync" to keep any trigger events up to date. These didn't sync with Network Animator any.
3. Repeat step one for any other state transition types.

In a nutshell, that should keep your players sync'd up, it's a bit more network traffic (actually lower than using network animator) and it keeps your players animations roughly syncronized without the pesky behavior leak.

Cheers,
T
0 REPLIES 0