How can I generate a random number?

I’ve heard all the scary stories about rand(), and am wondering if there is an alternative to using FMath to generate a random number, as all of Unreal Engines built in random number generation uses rand(). (At least as far as I am aware)

Thanks!

FMath random should be fine. But if you’re looking for a different solution for randomness try using FRandomStream with seeds.

More here:

Cheers

Thanks, is there anyway I could use the include from C++ 11?

Normally you should be able to use it as a normal include. If that doesn’t work try to implement it as a external library.

You can find more to this here:

Hope that helps you.