RealDocs

UKismetMathLibrary::SeedRandomStream

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Reseeds a random stream using the engine's global RNG (FMath::Rand), producing a new, unpredictable starting point for subsequent draws.

Caveats & Gotchas

  • Because it seeds from FMath::Rand(), the result is only as unpredictable as the global RNG's current state — it is not suitable if you need cryptographic randomness or independence from other code that also calls FMath::Rand.
  • This makes the stream's future sequence non-deterministic, which defeats the point of using an FRandomStream for reproducible results — use SetRandomStreamSeed with a known value instead if determinism matters.

Signature

static void SeedRandomStream(UPARAM(ref) FRandomStream& Stream)

Parameters

Name Type Description Default
Stream FRandomStream& The random stream to reseed.

Return Type

void

Example

Give a stream a fresh unpredictable seed C++
UKismetMathLibrary::SeedRandomStream(LootStream);
int32 Roll = UKismetMathLibrary::RandomIntegerFromStream(LootStream, 100);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.