Random

Category: Listener Tier: Basic

Purpose

Triggers randomly based on a probability percentage, useful for creating unpredictable behaviors and variations.

Visual Reference

As added to your scene
Random brick as it appears in the GDLink editor

When To Use

  • Enemy AI variation (50% chance to attack, 50% to defend)

  • Loot drops (20% chance to drop rare item)

  • Environmental effects (10% chance for lightning each second)

  • NPC dialogue (random conversation starters)

  • Spawn systems (random enemy types)

  • Particle variations (random colors, sizes, directions)

  • Idle animations (occasional fidget movements)

Runtime Behavior

Triggers: Each tick, generates a random number and triggers if it falls within the chance threshold

Generated UI Mockup — showing expanded properties
Random
-
x
Name:
Label this brick...
Chance (%):
50.0
v
Invert

Properties

Property

Type

Default

Notes

Chance (%)

float

50.0

Probability of triggering (0-100%) each tick

Example Use Cases

Random Enemy Behavior:

Sample inspector layout removed for compatibility.

Rare Loot Drop:

Property(enemy_dead, Equal, true) -> AND -> Random(20%) -> Scene(spawn_rare_item)
// 20% chance to drop rare item on death

Occasional Lightning:

Delay(60, repeat=true) -> AND -> Random(10%) -> Sound(thunder) + Material(flash)
// Every second, 10% chance for lightning

Random Idle Animation:

Delay(120, repeat=true) -> AND -> Random(30%) -> Animation(fidget)
// Every 2 seconds, 30% chance to play fidget animation

Random Spawn Type:

Sample inspector layout removed for compatibility.