Check if entity has component type in job? (useful for ComponentDataFromEntity)

Sometimes it seems it is necessary to check if a component exists before doing ComponentDataFromEntity. Thus I’d like to check if an entity has a component in a job. Thanks.

There is exist ( entity ) method there. Is this one not appropriate for you?

1 Like

Oh sweet, thanks. I haven’t heard of this. I’m looking for the docs. How does it work in a job?

Very similar as getting data from component array. But instead passing entity as index, myComponentArray [entity] ; you do myComponentArray.exitst ( entity ) ; It just returns bool value.

Sorry I am on mobile, to check its correctness for 100%

1 Like

Thank you! very cool