I'm animating a roulette table; above the roulette is an animated text with random numbers untill the winning numbers apears on the roulette table; but the random numbers are from 0-99; i've made it so that the 2 numbers are each on a layer; so that limits it to 0-9; but i would like the animation of the first layer to 0,1,2 or 3. I was searching for a regex but i have no clue what i'm doing...

In any way; i would love it when the random numnbers would be between 00 and 36 as that are the only numbers on a roulette table.

Thanks guys !

1 Answer 1


To do this on one text layer you could use this expression in the sourceText:


If you'd like to keep the two layers then on the first layer use:


and on the second layer use:


The number in the brackets of the random expression is the limit, so if it's set to 100, the random expression will return a value between 0 and 100.

  • Thanks ! But; i'm probably doing something wrong because i'm still saying higher numbers in my random count. ibb.co/y6s8vyv
    – Randy V
    Apr 28, 2020 at 8:39
  • Is it the text animator? If it's changing the character value then this may be the cause - try removing the text animator and see if it limits the randomness. Apr 28, 2020 at 8:59
  • If you make an expression like this: Math.round(random(36)); You will get random numbers between 0 and 35, as the expression counts from zero. A roulette table has numbers from 0-36, so you probably want Math.round(random(37));
    – tomh
    Jan 13, 2023 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.