#Accessing LocalTransform data of different entities during a parallel Job

1 messages · Page 1 of 1 (latest)

eternal ibex
#

Hello again! I'm continuing to learn how to use DOTS to create parallel jobs, however, I am running into a bit of a difficulty. I've figured out how to modify DynamicBuffers of other entities in a Job using a BufferLookup, but when I try the same with a ComponentLookup to use other data, particularly LocalTransforms for read-only purposes, I get the error that the ComponentLookup has been invalidated by a structural change.

Is there some sort of other way to access component data of different entities like that during parallel Jobs? Any help would be much appreciated!

And if it's not possible to do so, is this an instance where parallel Jobs aren't appropriate?

inland mural
#

Execute(in LocalTransform localTransform)?

eternal ibex
#

Forgive me for being unclear. I have a set of components specified by my Execute, including localTransform. However, there are other entities that I need to modify the data of besides those specified by the components in the Execute. Essentially, each entity specified by the Execute is connected to other entities, and it is those secondary entities' localTransforms that I need to read data from.

#

I know which entities those secondary ones are. I am already modifying DynamicBuffers they have using a BufferLookup. But I need to access their component data too - in this case, a localTransform.

marsh kestrel
#

You can disable safety of the container and it will work. Reason it doesnt, is because the code gen duplicates your local transform handle. If you don't want to disable safety, you can just use the lookup even on itself, by passing "Entity entity" into the execute definition

[NativeDisableContainerSafetyRestriction]
public ComponentLookup<LocalTransform> LocalTransform;

private Execute(in LocalTransform) {

}
#

Oh wait, my solution is when you want to modify smth on your children and the executing note. But in any case, to modify children you must disable safety using [NativeDisableParallelForRestriction,]