Function ambient_api_core::entity::wait_for_component
source · pub async fn wait_for_component<T: SupportedValue>(
entity: EntityId,
component: Component<T>
) -> Option<T>
Expand description
Waits until id
has the component
. If the entity was deleted, the method returns None
.
As the entity may have been despawned, you must handle the return value and not assume that the entity exists.