A* Pathfinding Project

Seeker/Agent won't move after update


#1

I just upgraded from 4.0.11 to 4.1.12 and my worst fear happened…updating broke the game! Not fun.
I have also tried deleting and re-importing but the same thing happens.

I can see that the path is being generated and the 2D grid graph looks fine. The seeker just won’t move.

The only error Unity is giving me that might be relevant is:
“Failed to create agent because there is no valid NavMesh”

Any help is much appreciated


#2

Hi

Failed to create agent because there is no valid NavMesh

That is not an error that comes from my package. That looks like something from Unity’s pathfinding system.
Are you sure there aren’t any other errors?

In the worst case if you are on a deadline, you can download the previous version from here: https://www.arongranberg.com/astar/download


#3

I do get these but not sure if this is an issue:

Upgrading serialized pathfinding data from version 4.0.11 to 4.1.12
This is usually fine, it just means you have upgraded to a new version.
However node data (not settings) can get corrupted between versions (even though I try my best to keep compatibility), so it is recommended to recalculate any caches (those for faster startup) and resave any files. Even if it seems to load fine, it might cause subtle bugs.

UnityEngine.Debug:LogWarning(Object)
Pathfinding.Serialization.AstarSerializer:OpenDeserialize(Byte[]) (at Assets/AstarPathfindingProject/Core/Serialization/JsonSerializer.cs:514)
Pathfinding.AstarData:DeserializeGraphsAdditive(Byte[]) (at Assets/AstarPathfindingProject/Core/AstarData.cs:327)
Pathfinding.AstarData:DeserializeGraphs(Byte[]) (at Assets/AstarPathfindingProject/Core/AstarData.cs:312)
Pathfinding.AstarPathEditor:DeserializeGraphs(Byte[]) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1339)
Pathfinding.AstarPathEditor:DeserializeGraphs() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1333)
Pathfinding.AstarPathEditor:LoadGraphs() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1298)
Pathfinding.AstarPathEditor:OnEnable() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:98)

UnityEngine.Debug:LogWarning(Object)
Pathfinding.Serialization.AstarSerializer:OpenDeserialize(Byte[]) (at Assets/AstarPathfindingProject/Core/Serialization/JsonSerializer.cs:514)
Pathfinding.AstarData:DeserializeGraphsAdditive(Byte[]) (at Assets/AstarPathfindingProject/Core/AstarData.cs:327)
Pathfinding.AstarData:DeserializeGraphs(Byte[]) (at Assets/AstarPathfindingProject/Core/AstarData.cs:312)
Pathfinding.AstarData:DeserializeGraphs() (at Assets/AstarPathfindingProject/Core/AstarData.cs:284)
Pathfinding.AstarData:Awake() (at Assets/AstarPathfindingProject/Core/AstarData.cs:163)
AstarPath:InitializeAstarData() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1245)
AstarPath:Awake() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1143)


#4

Ok I fixed it!

I had Rotation speed set to 0 and Rotate in 2D set to false. That used to work for me.

After the upgrade, I now set those to 360 and true, respectively, and it works.


#5

Ah. Rotation speed set to zero should work perfectly fine as long as the option ‘slow when not facing target’ is disabled. If that option is enabled then the AI will slow down when it is not facing the direction it wants to move in, and if it cannot rotate to the correct direction then it will not be able to move at all.


#6

Ok, that is not working for me then.

I have:
Rotation speed set to 0
Slow When Not Facing set to false
Rotation in 2D set to false

And my AI won’t move. Let me know if you want more details about my setup for diagnosis.


#7

It’s working perfectly fine for me with these settings:

(that was just by unchecking ‘slow when not facing target’ and setting the rotation speed to zero in the “Example 2” example scene).

Do you use similar settings?


Top down 2d, AI Path with rotation off
#8

This is what I got


#9

Hm… I tried with those exact settings in the Example2 example scene and it still worked fine.
The only difference I suppose was that I didn’t use a rigidbody. What happens if you remove that?


#10

Tested removing the rigid body but it still is not working


#11

What if you apply those settings to the bot in the Example2 example scene?