# Random stream in ActorComponent doesn't give consistent random results

**URL:** <https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974>\
**Category:** Blueprint\
**Tags:** actorcomponent, unreal-engine, construction-script, bug-report, Blueprint, question\
**Created:** [July 29, 2015, 4:20pm UTC](https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974 "2015-07-29T16:20:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [July 29, 2015, 4:20pm UTC](https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974/1 "2015-07-29T16:20:27Z")

</div>

I have a master blueprint class derived from _Actor_, that is placed in the world. This BP Actor is called\*"Path\*. In _Path_ I have added an _ActorComponent_ based BP called _RandomTest_.

In both _Path_ and _RandomTest_ I have a visible, editable, variable called _Random_ which is of type _Random Stream_.

Inside the Construction Graph for _Path_ I do some things, and then call a custom event on its components to let them do some things. The result is that whenever _Path_ is changed in the editor, not only is its construction graph run, but also a pseudo-construction graph is run for all attached components.

Now the problem I am running into is that random streams acts as expected in the main Actor, _Path_, they do not act as expected in the components, such as _RandomTest_. Despite no change in the random seed, the values inside the components are not consistent, and give different results every time.

I set up a very simple test, where in the Actor _Path_ I use Random Integer in Range From Stream to get a value and print it out, and then do the same in the component. I can clearly see the random value in the Actor remaining the same each cycle, and the value in the component just as clearly changing each cycle. I have confirmed that the seed is **not** changing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [July 29, 2015, 5:24pm UTC](https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974/2 "2015-07-29T17:24:51Z")

</div>

Hello,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

1. Can you reproduce this issue in clean project?
2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
3. Could you provide screen shots of any blueprints that may be involved?
4. Could you provide any code changes that you may have made that would be involved with this issue?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [July 29, 2015, 5:28pm UTC](https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974/3 "2015-07-29T17:28:59Z")

</div>

Thanks for your response. I have not attempted this on a clean project, but will attempt to do so in a little bit. No code changes have been made.

As for screenshots, I can try if it is really important, but due to MPAA restrictions, it is a large deal to get **any** data out of the studio and requires a lot of hoop jumping 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [July 29, 2015, 10:43pm UTC](https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974/4 "2015-07-29T22:43:01Z")

</div>

Sorry I still haven’t found the time to try this on a new project, but something I did find out is that if I manually set the stream’s seed and reset the stream, at the start of each cycle, then it works properly. So I have a workaround.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [August 3, 2015, 2:00pm UTC](https://forums.unrealengine.com/t/random-stream-in-actorcomponent-doesnt-give-consistent-random-results/326974/5 "2015-08-03T14:00:27Z")

</div>

Hello,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.
