Hi, new here.

I realized that this "randi() % x" code will always give same numbers in order. For example, if it's "randi() % 10", it will give 9, then 0, then 7.... when printed, as random results for one variable that has a value of "0" at the beginning.

When i play it again, same numbers in same order is being given as a result. Is there a way to get real random numbers?

You need to use different seeds in the random number generator if you want to get different results each time. You can use the randomize function (documentation) to have Godot generate a random seed, I believe using the system time. Also, welcome to the forums!

Thanks! Just added randomize() under func _ready() and it's working now :)

3 years later