NateTheGreatt/bitECS

Entity Exists

yairhaimo opened this issue · 3 comments

Is there a way to see if an entity exists in the world?

I believe you can use entityExists(world, entity)

https://github.com/NateTheGreatt/bitECS/blob/master/src/Entity.js#L128

Ah, great. Didnt see it in the api docs.
Thanks!

@vegeta897 @yairhaimo this API function hasn't been released yet FYI, but i will be publishing a release with it soon.

however, there is a caveat here, as explained in this related and still open issue:
#68 (comment)

tl;dr because entity IDs are recycled it is entirely possible that a new entity was created with the same ID that was removed. still working on a fix for this potentiality