FMath::RandRange
calls the c function rand()
under the hood (via FMath::RandHelper
, FGenericPlatformMath::FRand
and FGenericPlatformMath::Rand
). Unfortunately rand()
isn’t thread-safe which might be the problem here.
rand()
is not guaranteed to be thread-safe.
rand - cppreference.com.
Since you probably want to avoid having to lock access to the random numbers you may want to look into using a local FRandomStream
instance instead. You can initialize/seed those differently outside the thread.