diff --git a/src/engine/EntityComponentSystem/Entity.ts b/src/engine/EntityComponentSystem/Entity.ts index 3bfdf17f..83c2170c 100644 --- a/src/engine/EntityComponentSystem/Entity.ts +++ b/src/engine/EntityComponentSystem/Entity.ts @@ -292,6 +292,15 @@ export class Entity implements OnIniti } } + /** + * Check if a child entity exists on the parent entity + * @param child entity to check for + */ + public hasChild(child: Entity): boolean { + return child.parent === this; + } + + /** * Adds an entity to be a child of this entity * @param entity