hi there, i'm new to entities/jobs and trying to understand the cause of the following error:
InvalidOperationException: The previously scheduled job FireArrows:ReadTargetPosJob reads from the ComponentTypeHandle<Unity.Transforms.LocalToWorld> ReadTargetPosJob.JobData.__TypeHandle.__Unity_Transforms_LocalToWorld_RO_ComponentTypeHandle. You are trying to schedule a new job LocalToWorldSystem:ComputeWorldSpaceLocalToWorldJob, which writes to the same ComponentTypeHandle<Unity.Transforms.LocalToWorld> (via ComputeWorldSpaceLocalToWorldJob.JobData.LocalToWorldTypeHandleRW). To guarantee safety, you must include FireArrows:ReadTargetPosJob as a dependency of the newly scheduled job.
i understand that there are potential synchronization issues between me reading LocalToWorld in a job and the built-in systems writing to it during ComputeWorldSpaceLocalToWorldJob, but i don't understand why the error is thrown when it is.
- i've read the explanation for this error in the common error messages.
- i believe i'm wiring up
state.Dependencycorrectly to capture all scheduled jobs. - i've tried other flavors specify the dependencies in
state.Dependency, manually combining them again viaJobHandle.combineDependenciesto no avail.
so i feel like i must have a gap in my understand of how these system operate, or i'm missing something more fundamental.
some abbreviated examples, to follow. happy to post more context if desired or needed.