Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Random#

Math / Random

  • Can Read

  • Cannot Write

Description#

Returns True or False randomly

Code#

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;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.