Explore more
Functions

Math variables

3min

Use math variables to insert a random number into your functions.

random

Returns a floating-point, pseudo-random number in the range [0,Ā 1)Ā (inclusive ofĀ 0, but notĀ 1).

Use the following formula to generate an integer pseudo-random number in the range [min,Ā max] (inclusive of both,Ā minĀ andĀ max):

Math variable - random
ļ»æ
Text
ļ»æ

Example

Roll the dice

You can employ theĀ randomĀ variable to create a dice game that randomly picks a number, for example between 1 and 6, and then returns that number to a user.

1

In the mapping panel of the Tools > Set variable module, select the Math functions tab.

Random math variable
ļ»æ
2

Select theĀ floorĀ function.

3

Insert the following:

Text
ļ»æ

ļ»æ