2
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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