Pass Random Stream through Interface by REFERENCE?

I have a random level generator blueprint which is randomly spawning some actors at runtime, inside which I have more blueprint script to perform further random generation.

The level generation uses a random stream, and I would like the generation inside the actors which it spawns to also use the same random stream.

However, it seems as though using a Blueprint Interface to pass the random stream to the spawned actors destroys the original reference to the Random Stream variable contained inside the level generator blueprint.

I can check the box inside the blueprint interface ‘Pass-By-Reference’, however the pin does not change from circular to diamond, and does not reference the stream but instead copies it.

What can I do?

Thanks!

Jackson

Create a variable in the spawned actors class. In the variable details panel tick “Instance Editable” && “Expose on Spawn”.

When you go to spawn the class that variable will now be exposed on the “Spawn actor from class” node.

Just pass the value directly.

Found the solution. It was an error in my code, I was accessing the wrong stream in my actors, and assumed it was the interface causing the issue because the Random Stream pin doesn’t appear as a diamond when passing references (it should :laughing: :sweat_smile:.)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.