I’m also trying: var value = GetComponentDataFromEntity<myComponent>(false)[anotherEntity];
I have the id of anotherEntity in the form of an int, but then do not know how to get the Entity in the job: Entity anotherEntity = does anyone know the answer (anotherEntityId)
No idea if this is the right approach, or what other code I need to write. So really grateful for any help. Thanks )
I’m not trying to access a parent. I’d just like to access a certain type of component in a job and refer to it by entity. It used to be that you could do this with ComponentDataArray. But, how do you do it now?
But you can do it with GetComponentFromEntity()[entity].
I don’t get the problem.
The above was an example.of usage in a job, Parent.Value is an entity.
That makes sense, GilCat.
I realise now the other part of my problem is getting the entity.
What I want to do is have an entity with a component on it that refers to some other entity (like an edge in a graph),
That’s what I’m having trouble with in implementing. Any ideas?
I use exactly that. I have and Edge component that has reference to source entity and target entity and from there i can access whatever components i want both on source and target.
public struct EdgeComponent : IComponentData{
public Entity Source;
public Entity Target
}
Then use IJobProcessComponentData
Works great for me!