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. On :give("key", key?), an omitted key is generated by the World; an explicit key is registered if free.

Extends ComponentClass.

Method Description
Key:deserialize Assigns a key from serialized data.
Key:removed Callback: Clears the World key when the Component is removed (not replaced).