SpatialTemplateSeatElement
A spatial template element that represents a seat for a participant in the activity.
Declaration
struct SpatialTemplateSeatElementOverview
Add SpatialTemplateSeatElement types to a custom SpatialTemplate to specify the placement and orientation of participants in a group activity. When an activity starts, the system places participants into the shared coordinate space and orients them according to the seat information you provide. If you associate roles with one or more seats, participants must acquire the associated role before they can occupy the corresponding seat.
Create seat elements directly from this type and add them to the elements property of your custom template. Alternatively, use the inherited seat(position:direction:role:) function to create seats, as shown in the following example, which creates two seats on either side of the app’s content along the z-axis:
struct BasicTemplate: SpatialTemplate {
var elements: [any SpatialTemplateElement] = [
.seat(position: .app.offsetBy(x: 0, z: 1)),
.seat(position: .app.offsetBy(x: 0, z: -1)),
]
}