Not allowed to access vertices on mesh on Restart

Hi,

I get the following error when RESTARTING my game, which I do in the standard way, reloading the scene. So first gameplay, on an already generated from the editor recast graphs works, then this appears. Ideas? Do I need to do something special when restarting my scene?

I am on this version : 4.2.15 (2020-03-30)

Not allowed to access vertices on mesh ‘SM_Veh_Pickup_Technical_01_Wheel_fl’ (isReadable is false; Read/Write must be enabled in import settings)
UnityEngine.Mesh:get_vertices()
Pathfinding.Recast.RecastMeshGatherer:CollectSceneMeshes(List`1) (at Assets/AstarPathfindingProject/Generators/Utilities/RecastMeshGatherer.cs:76)
Pathfinding.RecastGraph:CollectMeshes(Bounds) (at Assets/AstarPathfindingProject/Generators/RecastGenerator.cs:747)
Pathfinding.d__50:MoveNext() (at Assets/AstarPathfindingProject/Generators/RecastGenerator.cs:660)
Pathfinding.d__46:MoveNext() (at Assets/AstarPathfindingProject/Generators/RecastGenerator.cs:583)
d__142:MoveNext() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1796)
d__141:MoveNext() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1733)

It looks like some script in your project calls Mesh.UploadMeshData with true as the parameter (see https://docs.unity3d.com/ScriptReference/Mesh.UploadMeshData.html). This means the pathfinding script will no longer be able to read the mesh data and thus cannot generate a navmesh.

Note that you can also cache the graph to avoid having to calculate the graph when the game starts (this assumes your world isn’t procedurally generated or anything like that though). See https://www.arongranberg.com/astar/docs/save-load-graphs.php

Thanks for the info. Question: Could this be because I mark my terrain elements as “Static”? Here it is indicated that blocks accessing vertices:

https://answers.unity.com/questions/681892/not-allowed-to-access-vertices-on-mesh-.html

Also I am only scanning Colliders so wonder why it tries to access Mesh at all… try and have a look at attached screenshot.

Screenshot 2020-12-03 at 18.22.50

I don’t think so. The mesh is named “SM_Veh_Pickup_Technical_01_Wheel_fl”, which doesn’t sound like a terrain part.

Note that mesh colliders are still meshes, and they can be marked as not readable.