#Repeatedly using Random Array Item / int from Stream

1 messages · Page 1 of 1 (latest)

unkempt umbra
#

Heyo, so I want to get x amount of random items from an array without duplication (i.e. avoid getting the same index twice), using a random stream for seeded purposes in the future.

Problem is that it's giving me a straight line of items starting at a random index, instead of picking each one out randomly. Any ideas? https://blueprintue.com/blueprint/01oiqggx/

Random Stream is stored in a Game Instance, which gets a new random seed (Seed Random Stream) on Init.

#

Noticed blueprintUE isn't showing the Random Array Item from Stream node correctly

mellow pivot
#

are you supposed to put a context in there ?

unkempt umbra
#

Nope.

#

For full clarity

lyric elk
#

The random stream that's being got isnt changing during the for loop I think. If that isn't changed then its like selecting the same X over and over and you're removing the last one so it just picks the next one.

#

At least I think that's what is happening

unkempt umbra
# lyric elk The random stream that's being got isnt changing during the for loop I think. If...

Except it should be changing, if this video is anything to go by https://www.youtube.com/watch?v=CaTOreZNBu8

What Is the Random Stream Node in Unreal Engine 4

Source Files: https://github.com/MWadstein/UnrealEngineProjects/tree/WTF-Examples
Note: You will need to be logged into your Epic approved GitHub account to access these examples files. https://github.com/EpicGames/Signup

▶ Play video
#

Simplifying the problem

#

Okay so I figured out the problem

#

The problem was because it was within a function.

#

this works