Readonly Reading of entities

Hi,

I have 3 jobs which should normally work all at the same time. But unity is telling me that one job has an input dependency of the other job.

var in1 = new JSetPositionHeight(LerpSystem.CurrentLerpTime).Schedule(this, inputDeps);

            var in2 = Entities.ForEach((ref Scale scale, ref Lerpable lerpable) =>
                {
                    scale.Value = 4 * lerpable.LerpTime;
                })
                .WithBurst()
                .Schedule(inputDeps);

            var in3 = Entities.ForEach((ref NonUniformScale scale, ref Lerpable lerpable) =>
                {
                    scale.Value = new float3(0.4f, 10, 0.4f) * lerpable.LerpTime;
                })
                .WithBurst()
                .Schedule(inputDeps);

JSetPositionHeight reads ONLY from Lerpable
both foreach loops ALSO read only from lerpable so i wonder how i can make these work in parallel.

Thank you.

Change ref to in for Lerpable. That tells Unity it is ReadOnly.

2 Likes

Don’t know if you are doing that already or not, but in the end you must combine those 3 input handles for the jobs to run in parallel of each other.

1 Like

Yes iam doing that.

Worked thank you