|
@@ -202,12 +202,12 @@ Note that a new instance must be added to the scene using ``add_child()``.
|
|
var mob_spawn_location = $MobPath/MobSpawnLocation
|
|
var mob_spawn_location = $MobPath/MobSpawnLocation
|
|
mob_spawn_location.progress_ratio = randf()
|
|
mob_spawn_location.progress_ratio = randf()
|
|
|
|
|
|
|
|
+ # Set the mob's position to the random location.
|
|
|
|
+ mob.position = mob_spawn_location.position
|
|
|
|
+
|
|
# Set the mob's direction perpendicular to the path direction.
|
|
# Set the mob's direction perpendicular to the path direction.
|
|
var direction = mob_spawn_location.rotation + PI / 2
|
|
var direction = mob_spawn_location.rotation + PI / 2
|
|
|
|
|
|
- # Set the mob's position to a random location.
|
|
|
|
- mob.position = mob_spawn_location.position
|
|
|
|
-
|
|
|
|
# Add some randomness to the direction.
|
|
# Add some randomness to the direction.
|
|
direction += randf_range(-PI / 4, PI / 4)
|
|
direction += randf_range(-PI / 4, PI / 4)
|
|
mob.rotation = direction
|
|
mob.rotation = direction
|