# How to set seed for a Predictable Random number

**URL:** <https://forums.unrealengine.com/t/how-to-set-seed-for-a-predictable-random-number/334196>\
**Category:** C++\
**Tags:** random-numbers, unreal-engine, CPP, question\
**Created:** [October 4, 2015, 1:28am UTC](https://forums.unrealengine.com/t/how-to-set-seed-for-a-predictable-random-number/334196 "2015-10-04T01:28:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CosmicDreamStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CosmicDreamStudios](https://forums.unrealengine.com/u/CosmicDreamStudios)\
**Post date:** [October 4, 2015, 1:28am UTC](https://forums.unrealengine.com/t/how-to-set-seed-for-a-predictable-random-number/334196/1 "2015-10-04T01:28:32Z")

</div>

I’ve tried using FMath::SRandInit(Seed) to get predictable random numbers but doesn’t work and the results change every game. This seems to be what the documentation shows. Seems simple enough but can’t figure this out. Anyone understand how to do this?

---

<div class="post-metadata">

**Author:** ![CosmicDreamStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CosmicDreamStudios](https://forums.unrealengine.com/u/CosmicDreamStudios)\
**Post date:** [October 4, 2015, 2:14am UTC](https://forums.unrealengine.com/t/how-to-set-seed-for-a-predictable-random-number/334196/2 "2015-10-04T02:14:52Z")

</div>

To be more clear I need to set the seed for a RandRange so I can set the min and max values.

---

<div class="post-metadata">

**Author:** ![CosmicDreamStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CosmicDreamStudios](https://forums.unrealengine.com/u/CosmicDreamStudios)\
**Post date:** [October 8, 2015, 5:54pm UTC](https://forums.unrealengine.com/t/how-to-set-seed-for-a-predictable-random-number/334196/3 "2015-10-08T17:54:22Z")

</div>

Alright figured this out. After playing around for a while I discovered that SRand and Rand are not fed by the same Init. So if anyone later finds they are having an issue with this know that Initializing one seed will not affect the other.
