InvalidOperationException: Not allowed to access vertex data on mesh 'foo'


PolySpatial has another land mine for us in the form of any Mesh that doesn’t have Read/Write ticked, will result in the following runtime error:

InvalidOperationException: Not allowed to access vertex data on mesh 'Cube' (isReadable is false; Read/Write must be enabled in import settings)
  at UnityEngine.Mesh+MeshDataArray..ctor (UnityEngine.Mesh mesh, System.Boolean checkReadWrite) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Mesh.AcquireReadOnlyMeshData (UnityEngine.Mesh mesh) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.LocalAssetManager.ProcessChanges () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialCore.PolySpati

Is it possible for the PolySpatial team to have a general solution for this? Is there any downside of having it forced enabled on the Unity side? Secondly, if it’s truly not possible, can you please print out a full path for the object, as oftentimes we’ll have generic local names like “Cube”, making it difficult to track down.

Thanks in advance!


We usually handle this in app build in Unity, so I’m wondering where these items are coming from? Are you creating them at runtime or are they part of the project when built?

Sorry, that’s for textures. My mistake. Though still interested on where these meshes are coming from that are not R/W? It may be that we’ll need to do something similar for meshes that we do for textures if possible.

I encountered the same issue while loading asset bundles.

In my experience, I resolved it by modifying the “platformRequiresReadableAssets” value in the “ProjectSettings.asset” of the project used to build the asset bundle.

platformRequiresReadableAssets: 1

Thank you, I’ll give that a go.

Hey joejo,

Yeah, it’s basically for any meshes that artists are adding to our game. So it’s just acting as a bit of a tax at the moment, chasing these things down. Just feels like a class of problem that can be erased for all PolySpatial developers at the “stroke of a pen” on the PolySpatial side.



Please file a bug and post it here. That way we can get it on our roadmap/discussions internally much sooner.