Contents

localParticipantStates

An asynchronous sequence that reports changes to the local participant’s state.

Declaration

final var localParticipantStates: SystemCoordinator.ParticipantStates { get }

Mentioned in

Discussion

Use this property to detect when the current person starts or stops displaying their spatial Persona. The following example shows how to set up a task to monitor the sequence and respond to changes:

Task.detached {
    for await localParticipantState in systemCoordinator.localParticipantStates {
         if localParticipantState.isSpatial {
              // Handle changes to the state.
         }
    }
}

See Also

Getting the participant state