I've been trying to create a spawn job that uses parralism to achieve maximum performence. I'm using EntityCommandBuffer.ParallelWriter to instantiate entities and then set their component data.
The problem is that once I playback the ECB, I get an error saying "InvalidOperationException: Structural changes are not allowed while iterating over entities. Please use EntityCommandBuffer instead.". This is called inside the ECB.Playback() function.
What am I doing wrong here?
https://pastebin.com/ygr065ar
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.