Entity:getComponents
Returns a shallow copy of the Entity's fields, excluding __world and __isEntity.
Returns a shallow copy of the Entity’s fields, excluding __world and __isEntity.
This is primarily the Entity’s Components. Extra non-component fields are also copied. Mutating a copied Component still mutates the Entity’s Component.
components = entity:getComponents( output )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
output |
table | Table to copy into. A new table is created if omitted. |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
components |
table |