---
tags:
    - "Dice"
---

# Random

[Math](index.md) / **Random**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns True or False randomly

## Code

```cs
using System;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Random")]
    [Category("Math/Random")]
    
    [Description("Returns True or False randomly")]
    [Image(typeof(IconDice), ColorTheme.Type.Yellow)]
    
    [Keywords("Dice")]
    
    [Serializable]
    public class TypeBoolMathRandom : TypeBool
    {
        public override bool Get(Args args)
        {
            return UnityEngine.Random.Range(0, 2) == 0;
        }

        public override string ToString()
        {
            return "Random";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnUpdate;
    }
}
```

