Download

[Blueprint Request] RND function

Would love to see a function that will return a random variable or float value, with min/max settings. The function node (RND) should have the following options in it’s detail panel:

Float/Integer dropdown (if this is not possible, then 2 separate RND functions, RND_INT and RND_Float)
Seed Value with pin
Min Value with pin
Max Value with pin

http://www.cplusplus.com/reference/random/mersenne_twister_engine/

It’ already there!

=> Random int in Range
=> Random float in Range

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/RandomStreams/index.html

Or do I misinterpret something?

What the flying !@#? I searched for random several times last night and none of those populated. I was using the material graph editor, so I may have had context sensitive checkbox checked. I’ll check again this morning. Thanks!

Materials are not Blueprints despite using a similar looking graph editor. Random Streams are a Blueprint feature. I’m not sure there is a node for getting a random value in a Material.

That’s probably why I couldn’t find it then :wink: Would it be possible to add a random integer / float value function to the material editor?

You could always use the Noise node in the Material editor, and then use one channel (r/g/b) from it. Don’t know if that would be truly “random”, but it may be random enough.

You need to implement this function, co is a seed, if you want animated noice you need place UV*Time


float rand(vec2 co){
    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

It’s GLSL code, so plasting this to custom node won’t work (but you can swap few things and it will work). It’s also possible to recreate this with nodes, i already tried that and it works :slight_smile:

Trying to create a fractal pattern using random integers / animatedchaos and such… So far all I’ve gotten is a black orb that looks a bit metallic :wink: