Skip to main content

Entity

Description​

This class represents an individual entity in the 8th Wall Studio scene graph, offering component access, state control, and hierarchical operations.

Properties​

PropertyTypeDescription
eidEidUnique identifier for this entity.

Component Methods​

get​

Access the current data for a component on this entity.

entity.get(component: RootAttribute<Schema>) // -> ReadData<Schema>

has​

Check if a component exists on this entity.

entity.has(component: RootAttribute<Schema>) // -> boolean

set​

Apply data to a component on this entity.

entity.set(component: RootAttribute<Schema>, data: ReadData<Schema>) // -> void

remove​

Remove a component from this entity.

entity.remove(component: RootAttribute<Schema>) // -> void

reset​

Reset a component on this entity to its default value.

entity.reset(component: RootAttribute<Schema>) // -> void

State Methods​

hide​

Hide this entity.

entity.hide() // -> void

show​

Show this entity if hidden.

entity.show() // -> void

isHidden​

Check if the entity is currently hidden.

entity.isHidden() // -> boolean

disable​

Disable this entity.

entity.disable() // -> void

enable​

Enable this entity.

entity.enable() // -> void

isDisabled​

Check if the entity is currently disabled.

entity.isDisabled() // -> boolean

delete​

Delete this entity from the world.

entity.delete() // -> void

isDeleted​

Check if the entity has been deleted.

entity.isDeleted() // -> boolean

Hierarchy Methods​

setParent​

Set this entity’s parent.

entity.setParent(parent: Eid | undefined | null) // -> void

getChildren​

Get this entity’s children.

entity.getChildren() // -> Generator<Eid>

getParent​

Get this entity’s parent.

entity.getParent() // -> Eid | undefined

addChild​

Make another entity a child of this one.

entity.addChild(child: Eid) // -> void