godot-steering-ai-framework/project/demos/group_behaviors/Spawner.gd
2020-01-12 10:25:10 -05:00

19 lines
390 B
GDScript

extends Node2D
export var member: PackedScene
func _ready() -> void:
var followers: = []
for i in range(19):
var follower: = member.instance()
add_child(follower)
follower.position += Vector2(rand_range(-60, 60), rand_range(-60, 60))
followers.append(follower)
var agents: = []
for i in followers:
agents.append(i.agent)
for i in followers:
i.proximity.agents = agents