Contents

assignRole(_:)

Assigns the given spatial template role to the local participant.

Declaration

final func assignRole(_ role: some SpatialTemplateRole)

Discussion

For example, in a table tennis game with two teams you might have the following:

switch selectedTeam {
case .blue:
    systemCoordinator.assignRole(TableTennisTemplate.Role.blueTeam)
case .red:
    systemCoordinator.assignRole(TableTennisTemplate.Role.redTeam)
}

Note that assigning a given role does not guarantee that the participant will be placed in a seat with that role. If more participants are assigned a role than there are seats for that role, the participant may be placed in a non-roled seat instead. In most cases, your app should try to avoid allowing for that scenario.

See Also

Assigning the local participant role