Hi all,
I am having problems with the Scan function used in scripts for RecastGraph. When I use AstarPath.active.Scan() I always get an error saying that it’s not allowed to access vertex data, and complains about the isReadable (Read/Write in the import settings), but all of my assets have this Read/Write option disabled, and it only complains about some of them. It’s solved by checking the Read/Write option, but I don’t think this is the intended behavior (and not even a recommended one). I am using the last beta version (4.3.3.34) and Unity 2020.1.5f1.
The full stacktrace of the error is this:
InvalidOperationException: Not allowed to access vertex data on mesh 'Rename_01' at array index 0 (isReadable is false; Read/Write must be enabled in import settings)
UnityEngine.Mesh+MeshDataArray..ctor (UnityEngine.Mesh[] meshes, System.Int32 meshesCount, System.Boolean checkReadWrite) (at <a9810827dce3444a8e5c4e9f3f5e0828>:0)
UnityEngine.Mesh.AcquireReadOnlyMeshData (System.Collections.Generic.List`1[T] meshes) (at <a9810827dce3444a8e5c4e9f3f5e0828>:0)
Pathfinding.Recast.RecastMeshGathererBurst.Finalize () (at Library/PackageCache/com.arongranberg.astar@4.3.34/Generators/Utilities/RecastMeshGathererBurst.cs:93)
Pathfinding.RecastGraph.CollectMeshesBurst (UnityEngine.Bounds bounds) (at Library/PackageCache/com.arongranberg.astar@4.3.34/Generators/RecastGenerator.cs:1140)
Pathfinding.RecastGraph+<ScanAllTilesBurst>d__53.MoveNext () (at Library/PackageCache/com.arongranberg.astar@4.3.34/Generators/RecastGenerator.cs:761)
Pathfinding.RecastGraph+<ScanInternal>d__46.MoveNext () (at Library/PackageCache/com.arongranberg.astar@4.3.34/Generators/RecastGenerator.cs:602)
AstarPath+<ScanGraph>d__143.MoveNext () (at Library/PackageCache/com.arongranberg.astar@4.3.34/Core/AstarPath.cs:1847)
AstarPath+<ScanInternal>d__142.MoveNext () (at Library/PackageCache/com.arongranberg.astar@4.3.34/Core/AstarPath.cs:1774)
AstarPath.Scan (Pathfinding.NavGraph[] graphsToScan) (at Library/PackageCache/com.arongranberg.astar@4.3.34/Core/AstarPath.cs:1626)
Also I have the errors from this 2 posts, but they are fixed and they will be there in the next update, I guess?
Thanks!