0 votes

As in the title, I was experiencing some problems with creating a random values. Is there any possibility to use function randi() or any else and do not obtain the same result every time the game runs? Even in Tetris example the sequence of falling blocks is always the same, although the function randi() was used there.

P.S. I am sorry for my english, but i am still learning it :)

in Engine by (24 points)

3 Answers

+2 votes
Best answer
by (227 points)
selected by
+1 vote

putting randomize() on func _ready() might work...

by (16 points)
0 votes

Thank you both very much, I had tried randomize before and it hadn't work, but when I tried again a few days ago, I suddenly realised that I'm using it in a wrong order relative to the rest of my code :P Now everything works, so thank you again very much.

by (24 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.