#Doesn't make any sense
1 messages · Page 1 of 1 (latest)
I get this error
InvalidOperationException: The previously scheduled job ApplyHeighToVertex writes to the UNKNOWN_OBJECT_TYPE ApplyHeighToVertex.vertices. You are trying to schedule a new job PathMakerJob, which reads from the same UNKNOWN_OBJECT_TYPE (via PathMakerJob.vertices). To guarantee safety, you must include ApplyHeighToVertex as a dependency of the newly scheduled job.
Which makes complete sense basically what I have running is
so the error im getting is saying that apply height to vertex of first line is colliding with the path maker of the next line
All of the data of each line is completely unrelated, unshared and independent, the only common thing is from where the Vertex (.vertices) come from
Which would look something like this
MeshGenerationData data = new MeshGenerationData(){
meshInstances = new GenerationInstance[count],
meshDataArray = Mesh.AllocateWritableMeshData(count)
};
for(int i = 0; i < count; i++)
{
Mesh.MeshData meshData = data.meshDataArray[i];
NativeArray<Vertex> meshPoints = meshData.GetVertexData<Vertex>();
//more unrelated stuff
}
Now the thiing is, vertices here is meshpoints, and im storing each of those arrays in a diferent struct that will later be used by each line (pathmaker to apply height)
So i have no clue why it doesn't like making those jobs run in parallel
Further notes, forcing the whole line to be completed at the end of the job, scheduling the jobs sequentially, AllocatingWritableMeshData per struct, generating a new array per struct of meshPoints, all of those fix the issue
But It is recommended by documentation to allocate multiple meshes with Mesh.AllocateWritableMeshData to make things faster, so I wanted ot make use of that method