I am making a top-down 2D game and want to create a simple patrol between 4 points to get familiar with this package. I was following the get started tutorial, where it says to use
seeker.StartPath(transform.position, targetPosition, OnPathComplete); to set a path. But then I read somewhere else that you should use the AI Destination Setter Component.
I tried using
seeker.StartPath(transform.position, targetPosition, OnPathComplete); , But my character just ends up running in place ( a little bit backwards), even though the green line for his path is drawn correctly. It’s moving on the z-axis too which makes no sense because both for transform and target z = 0. If I move the character around when in play-mode it does move towards the green line sometimes, and other times it runs in place or backwards. Cant make any sense of it.
I would prefer to not swarm my scenes with Transform Targets so I would prefer to use this method of just putting in values. Is there something I could be missing? I simply copy+paste the first script from the get started tutorial.
AI destination setter it works as intended. I am OK using this if there was just some better docs on how to find out when a specific target is reached so I can do some action. And how to set new targets from script.
EDIT: Worth noting that the Debug.Log from OnPathComplete() is printed as soon as the scene starts. Without the path actually being complete.