Skip to content

Commit

Permalink
Merge pull request #43330 from KoBeWi/rngesus
Browse files Browse the repository at this point in the history
Call randomize() automatically
  • Loading branch information
akien-mga committed Apr 23, 2021
2 parents a3fbc0b + 497c3f9 commit 492b8aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,7 @@
<method name="randomize">
<description>
Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
[codeblock]
func _ready():
randomize()
[/codeblock]
[b]Note:[/b] This method is called automatically when the project is run. If you need to fix the seed to have reproducible results, use [method seed] to initialize the random number generator.
</description>
</method>
<method name="range_lerp">
Expand Down
2 changes: 2 additions & 0 deletions scene/main/scene_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,8 @@ SceneTree::SceneTree() {

GLOBAL_DEF("debug/shapes/collision/draw_2d_outlines", true);

Math::randomize();

// Create with mainloop.

root = memnew(Window);
Expand Down

0 comments on commit 492b8aa

Please sign in to comment.