PCG no random value?

Is there any way to create a random value? For either Bool or Lerp not based on Density.

Well, PCG uses seeds to produce the same sequence so that it doesn’t change every time you alter something.

If you’re using a custom blueprint node, just create a variable with the type “Random Stream”. At the beginning of your execute function, do GetRandomStream and set the output to your variable. This will set the seed of your BP node to the stream. Then you can just use RandomIntegerFromStream or RandomBoolFromStream on your variable to produce random data.

If you want it truly random where it changes every time you move or alter anything, you can just use RandomNumber or RandomBool directly or as the seed of a RandomStream.

If you’re talking about a random number in the main graph, you’ll have to be MUCH more precise what you’re after.

Also, you mentioned density… could you elaborate exactly what you need?

1 Like