I need to generate random integers in blender game engine using python. I don't want to use logic bricks for random generation. I just want plain python.
I'm using this to make something randomly select a sound to play.


1 Answer 1


Just regular old python, randint. Nothing special blender related for this one.

import random
random.randint(MinNubmer, MaxNumber)

You also could use the Random actuator. (but the pure python is simpler.)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .