# OvrRandom

### 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="/pages/b1CKABbBMOQzloECkQRm">OvrVariableType</a></td><td>Type of the variable</td></tr><tr><td>OvrRandomType</td><td><a href="/pages/TPGfCHCrpM8O8ulUnCle">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="/pages/MBXkPoiZc9oz36mgEMqy">OvrNumericVariable</a></td><td>Min. value of the range</td></tr><tr><td>Max</td><td><a href="/pages/MBXkPoiZc9oz36mgEMqy">OvrNumericVariable</a></td><td>Max. value of the range</td></tr><tr><td>Result</td><td><a href="/pages/MBXkPoiZc9oz36mgEMqy">OvrNumericVariable</a></td><td>Resulting value</td></tr><tr><td>QuaternionResult</td><td><a href="/pages/530PnZhC3E3vvJ2z2LJo">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](/files/KrqYB9Jk3BOiRtlnOuxX)

### 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.](/files/RfZTb1F4nMeIwS5zniHd)

![Example of OvrRandom, for OvrVector3 using Inside Unit Sphere function.](/files/HOgecrKmkGLnRU5NHQJD)

### 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.](/files/HNL8ojQFXFEQ73sbwFPK)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overthereality.ai/over-sdk-manual/ovr-component-system-ancient-legacy/nodes/logics/ovrrandom.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
