Godot Version (godot ver 4.2)
@onready var nav_agent := $NavigationAgent2D as NavigationAgent2D
##functions-----------------------------------------------
func makepath() ->void:
nav_agent.target_posistion = player.global_position
##built in functions -----------------------------------------------
func _ready():
var player = get_tree().get_nodes_in_group(“Player”)
print (player)
func _physics_process(_delta : float) → void:
direction = to_local(nav_agent.get_next_path_position()).normalized()
velocity = direction * speed
move_and_slide()
##called functions -----------------------------------------------
func _on_timer_timeout():
makepath()
Question
Im trying to do pathfinding for my enemies in my game but when i run this the enemy just doesnt move- no error appears. Im trying to figure it out but I cant