Random Integer from Stream is different each time

I have a variable Random Stream and i want to generate random integer from that stream, but each time it gives different result.


Shouldn’t it be the same result each time? Why is it changing?

Did you set the seed ?

3 Likes

Oh yeah, your method is working, but do I have to do this each time? I tried to set it in begin play once and don’t bother with it, but it keeps changing afterwards.

I think you have to, I tested with the initial seed and it’s not working for me too. Every initial seed gives 2,6,9,9…

2 Likes

Now i have to do this? And don’t do that?

2 Likes

When you set it in begin play it will give you the values you expect, but later if you want to get the same values again you have to set the seed again.

2 Likes

So you only need one value ? this should work for that.

2 Likes

I wish it was simpler, but i got it.

2 Likes

You can make it simplier by putting the code inside a Blueprint Function Library.

So you just need to code it one time and use the resulting Function globally, everywhere…

2 Likes