Random Stream in Character; Seed has no effect?
Hello, I'm on 4.21.2.
On the level blueprint I add a Random Stream variable, then on BeginPlay, PrintString a random integer from that stream. When I change the Initial Seed in my stream variable parameters, then the random integer is different on startup. That's the behavior I expect.
Now, if I do the exact same thing, but in the Character (for instance, in a blank 3rd person template, in ThirdPersonCharacter), then the Initial Seed has no effect. No matter the value I set it to, I will get the exact same integer from my PrintString.
Is there a reason it behaves differently in a Character, or might this be a bug?
If prior to using my Random Stream variable I set it using a Make Random Stream node, then changing the Initial Seed in the Make Random Stream node does produce the same behavior as in the Level BP.
So my question really is - why can't I use Initial Seed default value of the variable when in a Character BP?
Seed is a sequence distrubution that given value of initial stream. Random stream would call same sequence of distrubutions if you do not change initial seed. Therefore, invoking SetRandomStreamSeed to assign new value into your Initial Seed as property in your struct.
answered Jan 27 '19 at 12:35 AM
Yes, I know what streams are. But why doesn't it behave correctly when you change the initial seed in variable parameters, in a character BP? Why only when you set it through a node?
answered Jan 27 '19 at 09:03 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here