Caught exception while deserializing data. Error

Hi, We have serialization problem in start scene,If we use to save and cache mode.Can you suggest any advice to solve for it.
We are using 4.2.18 version.
2021.3.15 unity.

Caught exception while deserializing data.
System.Exception: Tried to deserialize a NodeLink2 reference, but the link could not be found in the scene.
If a NodeLink2 is included in serialized graph data, the same NodeLink2 component must be present in the scene when loading the graph data.
at Pathfinding.NodeLink2.DeserializeReferences (Pathfinding.Serialization.GraphSerializationContext ctx) [0x00130] in S:\HyperCasual\043CityHordeInvasion\Assets\Plugins\AstarPathfindingProject\Core\Misc\NodeLink2.cs:303
at Pathfinding.Serialization.AstarSerializer.DeserializeNodeLinks (Pathfinding.GraphNode[] int2Node) [0x00023] in S:\HyperCasual\043CityHordeInvasion\Assets\Plugins\AstarPathfindingProject\Core\Serialization\JsonSerializer.cs:729
at Pathfinding.Serialization.AstarSerializer.DeserializeExtraInfo () [0x00065] in S:\HyperCasual\043CityHordeInvasion\Assets\Plugins\AstarPathfindingProject\Core\Serialization\JsonSerializer.cs:717
at Pathfinding.AstarData.DeserializeGraphsPartAdditive (Pathfinding.Serialization.AstarSerializer sr) [0x0005e] in S:\HyperCasual\043CityHordeInvasion\Assets\Plugins\AstarPathfindingProject\Core\AstarData.cs:401
at Pathfinding.AstarData.DeserializeGraphsAdditive (System.Byte[] bytes) [0x00025] in S:\HyperCasual\043CityHordeInvasion\Assets\Plugins\AstarPathfindingProject\Core\AstarData.cs:368
UnityEngine.Debug:LogError (object)
Pathfinding.AstarData:DeserializeGraphsAdditive (byte[]) (at Assets/Plugins/AstarPathfindingProject/Core/AstarData.cs:378)
Pathfinding.AstarData:DeserializeGraphs (byte[]) (at Assets/Plugins/AstarPathfindingProject/Core/AstarData.cs:351)
Pathfinding.AstarData:LoadFromCache () (at Assets/Plugins/AstarPathfindingProject/Core/AstarData.cs:268)
Pathfinding.AstarData:Awake () (at Assets/Plugins/AstarPathfindingProject/Core/AstarData.cs:173)
AstarPath:InitializeAstarData () (at Assets/Plugins/AstarPathfindingProject/Core/AstarPath.cs:1364)
AstarPath:Awake () (at Assets/Plugins/AstarPathfindingProject/Core/AstarPath.cs:1256)

Hi

As the error message suggests, you have serialized a navmesh graph that contains node links. If they are included in the serialized data, they must also be present in the scene when the graph is loaded.

Hi Thanks for quick reply.
I tried to save them like this way.But It did not work either. Is there another way to make it ?

image

Hi

This is due to any NodeLink2 components you have in the scene. Are you sure they are also there when the game runs?

Yes, We used AnimationLink component as link in the scene.They are still in the scene.

Hi @aron_granberg ,
By the way, this problem is only one scene right now.It is weird. Maybe It is related with node numbers in the scene. I will try to figure it out.
Unfortunally, I lose all my day because of this problem.
Edit:Ok, When I decrease node numbers, problem fixed. Maybe there is a bug.

That’s odd. This shouldn’t have anything to do with node numbers.
You could try the beta, it is possible some bugs have been fixed there (I think there might have been a deserialization bug a while back). See A* Pathfinding Project
Make sure that you generate the cache in edit mode, not in play mode.