Random: 0 or 1 (Expression Function Reference)
 
 
 

The Function Random Random: 0 or 1 command in the expression editor inserts the token randBool([<seed>]) at the insertion point in the editing pane. This token generates 0 or 1 randomly at each frame. You can use these random values with Boolean expressions, where 0 = FALSE and 1 = TRUE. Replace the dummy argument as follows:

[<seed>]

Replace with an expression for a seed value used to sow the random number generator. This argument is optional.

If you supply a seed, pseudo-random numbers are generated for each frame. These numbers are the same each time you play back the scene.

If you do not supply a seed, the generated values are closer to being truly random. However, they will be different each time you play back the scene.

Example 1

randBool()

Generates 0 or 1 randomly at each frame. The sequence is different each time you play the scene back.

Example 2

randBool(17)

Generates 0 or 1 pseudo-randomly at each frame. The sequence is the same each time you play the scene back.