Skip to content

getrandomarrayelement 1

eisclimber edited this page Apr 4, 2026 · 1 revision

RuntimeUtils.GetRandomArrayElement(T[],float[])

Method in RuntimeUtils

Summary

Return a random element from the first array given the probabilities for each object. If probabilities is null, a linear distribution is used.

public static T GetRandomArrayElement<T>(T[] objects, float[] probabilities = null)

Parameters

Name Description
T[] objects Objects to draw from.
float[] probabilities Probabilities for each object.

Type Parameters

Name Description
T Type of the object to draw.

Returns

A random object from the array.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally