Question by
magmorta2012 · Nov 23, 2018 at 01:25 PM ·
c#gameobjectpathfindinginstantiate prefabconnection
How to I make a gameobject follow a list of nodes and to link an instantiated gameobject to a script.
Hi there. I recently asked something similar so I'll try provide more information and re-word it.
I have a class called Pathfinding. It requires a link to a start gameobject and an end gameobject and makes a list of nodes between the two in the shortest path. (A*).
What I need help with is:
How do I instantiate my enemy gameobject from a prefab and link it to this script (usually done by dragging the gameobject onto the respective tile in the editor).
How can I make a gameobject move by following the list created by the pathfinding algorithm (maybe takes the first one of the list, moves, then recalculates)?
Thank you very much. Ask me if its not clear enough and I'll try to provide screenshots or info. :)
Comment