Say I have health system that where an entity has health, and a dynamic buffer for changing health. Now any system can supposedly damage an entity by adding to that buffer. This has been working so far until I made a parallel job that does this by accessing a buffer lookup (with parallel safety disabled because each entity was only iterated once), where I'm getting an error of an unassigned dependency.
InvalidOperationException: The previously scheduled job ArcJob writes to the BufferLookup<HealthChangeBuffer> ArcJob.ObjectHealth. You must call JobHandle.Complete() on the job ArcJob, before you can read from the BufferLookup<HealthChangeBuffer> safely.
I've gotten this error before and I usually fixed it by adding the component type to the query, and adding state.dependency as a dependency. However, I have no clue how to go about this with a buffer lookup. The buffer component type is listed in the query but that doesn't seem to apply to the lookup itself. What am I missing?