What is the correct way of performing debug draw. I was looking at AnimNode_Fabrik.cpp and there do something which looks quite similar to what I am doing, so I am not sure what am I doing wrong.
I have also tried various combinations of switches for persistence of lines and their lifetimes, but no luck …
which will make the engine call that GatherDebugData function on active animation nodes.
Quick Explanation:
I don’t know how the code was in 4.12 but in 4.20.3 several main functions in AnimNode are named with _AnyThread postfix which implies they can be called from any thread. And since the debug draw crashes after awhile, sometimes sooner sometimes later, it feels like a threading issue.
Meanwhile the documentation (FAnimNode_Base::GatherDebugData | Unreal Engine Documentation) says that GatherDebugData is called from Game Thread, so it’s safe to draw debug etc. Another bonus is that the function provides you an UWorld to use with debug drawing via: