> For the complete documentation index, see [llms.txt](https://docs.overthereality.ai/over-sdk-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overthereality.ai/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/logics/ovrrandom.md).

# OvrRandom

Subclass of Ovr.OvrNode

### Description

This node is used to generate random values, based on the type of variable the user needs.

By changing the [OvrVariableType](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrvariable/ovrvariabletype.md), the requirements to get the random value change as well.

Attributes

{% hint style="info" %}
**Note**: the following attributes are added to the existing ones from the super class [OvrNode](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/ovrnode.md)
{% endhint %}

<table><thead><tr><th width="205.7659040188865">Name</th><th width="190.53867764271382">Type</th><th width="340.1572968009442">Description</th></tr></thead><tbody><tr><td>VariableType</td><td><a href="/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrvariable/ovrvariabletype.md">OvrVariableType</a></td><td>Type of the variable</td></tr><tr><td>OvrRandomType</td><td><a href="/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/logics/ovrrandom/ovrrandomtype.md">OvrRandomType</a></td><td>Type of function used to generate Random value (in case of Numbers, only Between is allowed)</td></tr><tr><td>Min</td><td><a href="/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable.md">OvrNumericVariable</a></td><td>Min. value of the range</td></tr><tr><td>Max</td><td><a href="/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable.md">OvrNumericVariable</a></td><td>Max. value of the range</td></tr><tr><td>Result</td><td><a href="/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable.md">OvrNumericVariable</a></td><td>Resulting value</td></tr><tr><td>QuaternionResult</td><td><a href="/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrquaternion.md">OvrQuaternion</a></td><td>Resulting rotation value</td></tr></tbody></table>

### Random Number

In order to generate a random number ([OvrInt](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrint.md) or [OvrFloat](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrfloat.md)), the user needs to provide the node with a maximum and minimum value. The result will be stored in a numeric variable.

![Example of numerical Random](https://content.gitbook.com/content/6xdubHTzJACGqFIM7yJy/blobs/DmSMiED75tUjku0Tra4Z/random_int.png)

### Random Vector

There are several ways to generate a new [OvrVector2](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrvector2.md) or [OvrVector3](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrvector3.md):

* Like for random numbers, between Min and Max Vectors;
* Inside a Unity Circle \[[OvrVector2](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrvector2.md)] or Sphere \[[OvrVector3](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrvector3.md)], by calculating a random Vector inside a sphere with radius 1, then scaled up using Min and Max values.
* On the surface of a Unit Sphere \[OvrVector3 only], by calculating a random Vector on the surface of a sphere with radius 1, then scaled up using Min and Max values.

Attributes are very similar to those above.

![Example of OvrRandom, for OvrVector3 using Between function.](https://content.gitbook.com/content/6xdubHTzJACGqFIM7yJy/blobs/vjTJXpzgPYnL1WZssI8J/random_v31.png)

![Example of OvrRandom, for OvrVector3 using Inside Unit Sphere function.](https://content.gitbook.com/content/6xdubHTzJACGqFIM7yJy/blobs/kRJQ7jeW1oFK8C2MDCd4/random_vec3inside.png)

### Random Rotation

To generate a new Rotation ([OvrQuaternion](/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/variables/ovrnumericvariable/ovrquaternion.md)), the user can either:

* Generate a simple random Rotation;
* Generate a random Rotation with uniform distribution

![Example of Random Rotation.](https://content.gitbook.com/content/6xdubHTzJACGqFIM7yJy/blobs/bWnZBWIiwQ3VmmHps5u7/random_rot.png)
