xyz alright then
heres the code:
extends Area2D
var current_scatter_index = 0
@export var speed = 75
@export var movement_targets = Resource
@export var tile_map = TileMap
@export var navigation_area_2d = $NavigationAgent2D
func _ready():
navigation_area_2d.path_desired_distance = 4.0
navigation_area_2d.target_desired_distance = 4.0
navigation_area_2d.target_reached.connect(on_position_reached)
call_deferred("setup")
func _process(delta):
move_ghost(navigation_area_2d.get_next_path_position(), delta)
func move_ghost(next_position Vector2 delta float)
var current_ghost_position = global_position
var new_velocity = (next_position - current_ghost_position).normalized()
func setup():
navigation_area_2d.set_navigation_map(tile_map.get_navigation_map(0))
NavigationServer2D.agent_set_map(navigation_area_2d.get_rid(), tile_map.get_navigation_map(0))
func scatter():
navigation_area_2d.target_position = movement_targets.scatter_targets[current_scatter_index].position
func on_position_reached():
if current_scatter_index < 3:
current_scatter_index += 1
else:
current_scatter_index = 0
and these are the errors listed (i figured out most of them but i tried to remove the comma and colon from line 20 but it still shows the error):
Line 20:Expected closing ")" after function parameters.
Line 20:Expected ":" after function declaration.
Line 20:Expected end of statement after expression, found "Identifier" instead.