system
1
|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
random_developer |
So, I think the title speaks for itself.
I just want to know how I randomly choose a variable from array in godot…
extra: I wanted to know more about the randomize() function
system
2
|
|
|
 |
Reply From: |
Gluon |
You can use something like this
arrayname[randi() % arrayname.size()]
You can see all the documentation for random number generation in the below link
it really worked, thanks for the answer and the documentation
random_developer | 2022-11-29 22:47
You are welcome good luck with your game
good to know that, i dont know if i gonna use godot 4 soon but, i will keep that in mind… thanks.
random_developer | 2022-11-30 02:16