Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Dragon20C |
Pretty much what the title says I am using randomize() in the ready function and yet my number stays the same in game and when I restart the game.
here is a pasteall link with my code in it,(Dont worry it only has a few lines)
Do you happen to still have the pasteall of that erroneous code? (I assume you deleted it- if not then something’s just wrong with the site at the moment so disregard)
I know you said you fixed it but I’m still having the problem and I’d like to see where you went wrong before you figured it out
seaking | 2021-02-02 06:00
simply put randomize() in the ready function
like so:
extends Spatial
func _ready():
randomize()
func _on_Area_body_entered(body):
var number = randi() % 100 + 1
if body is Player:
print(number)
if number < 30:
print("The number is less then 30 and is " + str(number))
Dragon20C | 2021-02-02 07:17