Skip to content
ConcordConcordConcord

Key

Built-in Component that assigns a unique key to an Entity in its World.

If the concord folder is in the root directory of your game, you can import this module like so:

Key = require('concord.builtins.key')

The Entity must belong to a World. Calling the Component returns the key value.

Extends ComponentClass.

Assigns a key from serialized data.

key:deserialize( data )
Name Type Description
data string|number Previously serialized key value

Callback: Clears the World key when the Component is removed (not replaced).

key:removed( replaced )
Name Type Description
replaced boolean True when the Component is being overwritten