Im pretty new to game dev and im Trying to make a rogue like but....

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kingarash1324

Im making a top down rogue like with procedural world gen . I’ve done everything neccessary for the game to BE a game, but adding enemies. Ive added pathfinding, made the enemy , tried it on a normal world, buuuut, when i try to add it as a child in the script (add_child)to my world so it spawns randomly in the map (when the enemy doesn’t have the pathfinding script it spawns just as intended), it doesn’t work. apparently it can’t connect itself to the navigation2d node in the world, idk what to do

:bust_in_silhouette: Reply From: Drawsi

Have you tried declaring the position of the enemy thru code upon instancing it?

It worked… i think… i added the enemy as a var to the navigation2d aswell and then the pathfinding started working, idk if that was what you meant (English is my 2nd language so idk some words) but if it was, thank you, ive spend 3_4 days on this one problem and now its working

Kingarash1324 | 2022-03-06 15:12