File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
getting_started/first_2d_game Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
311311
312312 # Choose a random location on Path2D.
313313 var mob_spawn_location = get_node("MobPath/MobSpawnLocation")
314- mob_spawn_location.progress_ratio = randi ()
314+ mob_spawn_location.progress_ratio = randf ()
315315
316316 # Set the mob's direction perpendicular to the path direction.
317317 var direction = mob_spawn_location.rotation + PI / 2
@@ -343,7 +343,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
343343
344344 // Choose a random location on Path2D.
345345 var mobSpawnLocation = GetNode<PathFollow2D>("MobPath/MobSpawnLocation");
346- mobSpawnLocation.ProgressRatio = GD.Randi ();
346+ mobSpawnLocation.ProgressRatio = GD.Randf ();
347347
348348 // Set the mob's direction perpendicular to the path direction.
349349 float direction = mobSpawnLocation.Rotation + Mathf.Pi / 2;
@@ -371,7 +371,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
371371 godot::Node *mob = mob_scene->instance();
372372
373373 // Choose a random location on Path2D.
374- _mob_spawn_location->set_progress_ratio((real_t)_random->randi ());
374+ _mob_spawn_location->set_progress_ratio((real_t)_random->randf ());
375375
376376 // Set the mob's direction perpendicular to the path direction.
377377 real_t direction = _mob_spawn_location->get_rotation() + (real_t)Math_PI / 2;
You can’t perform that action at this time.
0 commit comments