Quantcast
Channel: Work – Daniel
Viewing all articles
Browse latest Browse all 28

UE4 Blueprints getting a random index of array

$
0
0

The “Random Integer” node in Unreal Engine 4’s Blueprints system behaves exactly like “rand() % Array.Num()” would in C++. Tthis makes it perfect for selecting a random entry of a blueprints array.

The wording in the Blueprint’s tool tip words this as “Returns a uniformly distributed random number between 0 and Max – 1” which I feel is not a clear explanation of what you would use this for. Indeed the node “Random Integer in Range” sounds like it would be more appropriate for getting a random entry of an array yet because the Range’s max is treated inclusive it is inappropriate for task.


Viewing all articles
Browse latest Browse all 28

Latest Images

Trending Articles



Latest Images