I have two Systems. SystemA and SystemB - I set SystemB to run after SystemA with the UpdateAfter attribute on the SystemB System.
In SystemA i have created an EntityQuery that only uses .WithAll( - so no RW access.
In my systemA i schedule a job with my query - that job looks like this:
public partial struct MyJob: IJobEntity {
public void Execute([ReadOnly] ref MyProperties properties) {
UnityEngine.Debug.Log("Run");
}
}
I get this error:
You are trying to schedule a new job MyNewJob, which writes to the same ComponentTypeHandle<MyProperties>. To guarantee safety, you must include MyJob as a dependency of the newly scheduled job.
Clearly my Job will have to write to something at some point, so i might run into problems and need to include a dependency - but for now, i can't understand why I'm getting this error?
Btw i'm planning on (later) to write the data into a DynamicBuffer and the next System will then aggregate the data in the buffer, clear it and set the aggregated value on the component.