I’m trying to get Astar working with my 2D game. I have a character with Seeker, AIPath, and Ai Destination Setter scripts attached. I have set the target in the AI Destination Setter and when the game starts, the gizmo path is drawn between the character and the target, but the character does not move. The path will update if I change the target location but still the character doesn’t move. I get reports every second that say “Path Completed : Computation Time 0.00 ms Searched Nodes 55 Path Length 15”. Why would this be happening when the path is clearly not completed?
What are the settings for your movement script?
Here’s a screenshot showing the movement settings on AIPath https://i.imgur.com/xWTzZQf.png I have no other scripts dealing with movement, simply trying to get the character to move across the screen with the tools out the box. I tried changing the slow down and end reached distances to 0 and setting it to Continue to Exact Location when close to destination but no luck. I also disabled the box collider 2d and added a rigidbody 2d to see if that would help but neither thing did. No matter where I move the target on the grid graph, the gizmo will update but the character won’t move.
Here’s an example of the entire console message I get:
Path Completed : Computation Time 0.00 ms Searched Nodes 100 Path Length 19
Path Number 58 (unique id)
UnityEngine.Debug:Log (object)
AstarPath:LogPathResults (Pathfinding.Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:816)
AstarPath:b__122_1 (Pathfinding.Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1288)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler) (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:379)
Pathfinding.PathProcessor/<>c__DisplayClass24_0:<.ctor>b__0 () (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:108)
System.Threading.ThreadHelper:ThreadStart ()
Try to change the orientation setting.
Aha, that did it! Thank you so much!!