2022-12-15 13:49:38 +00:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
@onready var agent: CharacterBody2D = $Agent
|
|
|
|
@onready var agent_2: CharacterBody2D = $Agent2
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
var waypoints: Array[Node] = $Waypoints.get_children()
|
2023-04-14 08:28:33 +00:00
|
|
|
|
2022-12-15 13:49:38 +00:00
|
|
|
for wp in waypoints:
|
|
|
|
agent.add_waypoint(wp.global_position)
|
2023-04-14 08:28:33 +00:00
|
|
|
|
2022-12-15 13:49:38 +00:00
|
|
|
waypoints.reverse()
|
|
|
|
for wp in waypoints:
|
|
|
|
agent_2.add_waypoint(wp.global_position)
|
|
|
|
|
|
|
|
|