Skip to content

Choose a random value

Choose a random value in a list of strings or numbers.

Authors and contributors to this community extension: UlisesFreitas.


In an expression, use Choose::RandomString or Choose::RandomNumber and set the values you want to randomize separated by commas.

See also Array Tools extension for more advanced usages.

Tip

Learn how to install new extensions by following a step-by-step guide.

Expressions

Expression Description
Choose::RandomNumber(string) Choose a number randomly between comma-separated numbers.
string The string containing all numbers to choose randomly from, separated by commas Example: "10,20,30"
Choose::RandomString(string) Choose randomly between comma-separated strings.
string The string containing all options to choose randomly from, separated by commas Example: "option1,option2,option3"

This page is an auto-generated reference page about the Choose a random value extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.