get
Retrieves the entity with the specified ID. Returns null
if the entity does not exist.
Syntax
entities.get(id);
Parameters
Name | Type | Description |
---|---|---|
id | number or string | Entity ID |
Returns
EntityManager
- The entity with the specified ID ornull
if the entity does not exist.
Example
console.log('player', engine.players.get(1));
Available on: Client Server