findById

@MainThread
fun findById(id: Long): Entity?

Returns the entity registered in this Scene with the given runtime id, or null if no such entity exists in this scene.

The lookup is performed against the entities currently registered in this Scene only and runs in constant time. This method does not create or migrate entities and has no side effects:

  • Returns the entity if the id is registered in this scene.

  • Returns null if the entity has been removed from this scene or has never been added to it, even when it is still alive in another Scene.

Return

The matching Entity in this scene, or null when not found.

Parameters

id

The runtime entity id to look up.