While i’m still looking for answer, it’s worth mention that this suggestion doesn’t seems correct now. I’m on 5.3 and UWorld::AsyncLineTraceByChannel
calls the StartNewTrace
that has a guard against threading at the very begining:
// Using async traces outside of the game thread can cause memory corruption
check(IsInGameThread());
upd:
ActiveSound.cpp
Have an interesting comment at the line 1220
if (UWorld* WorldPtr = World.Get())
{
// LineTraceTestByChannel is generally threadsafe, but there is a very narrow race condition here
// if World goes invalid before the scene lock and queries begin.
bIsOccluded = WorldPtr->LineTraceTestByChannel(SoundLocation, ListenerLocation, OcclusionTraceChannel, Params);
}
So it seems default traces is a way to go now. At least they seems to work at the first glance.
Also there is a topic with an engine fix that seems relevant to the problem, but i’m don’t need it yet.