---
title: Scene
framework: realitykit
role: symbol
role_heading: Class
path: realitykit/scene
---

# Scene

A container that holds the collection of entities that an AR view renders.

## Declaration

```swift
@MainActor @preconcurrency class Scene
```

## Overview

Overview You don’t create a Scene instance directly. Instead, you get the one and only scene associated with a view from the scene property of an ARView instance.

To add content to the view’s scene, you first create and add one or more AnchorEntity instances to the scene’s anchors collection. Anchors tell RealityKit how to pin virtual content to real world objects, like flat surfaces or images. You then add a hierarchy of other Entity instances to each anchor to indicate the geometry and behaviors that RealityKit should render at a given anchor point.

## Topics

### Identifying the scene

- [name](realitykit/scene/name.md)

### Adding and removing anchors

- [anchors](realitykit/scene/anchors.md)
- [addAnchor(_:)](realitykit/scene/addanchor(_:).md)
- [removeAnchor(_:)](realitykit/scene/removeanchor(_:).md)

### Finding entities

- [findEntity(named:)](realitykit/scene/findentity(named:).md)
- [performQuery(_:)](realitykit/scene/performquery(_:).md)
- [findEntity(id:)](realitykit/scene/findentity(id:).md)

### Detecting intersections

- [raycast(origin:direction:length:query:mask:relativeTo:)](realitykit/scene/raycast(origin:direction:length:query:mask:relativeto:).md)
- [raycast(from:to:query:mask:relativeTo:)](realitykit/scene/raycast(from:to:query:mask:relativeto:).md)
- [convexCast(convexShape:fromPosition:fromOrientation:toPosition:toOrientation:query:mask:relativeTo:)](realitykit/scene/convexcast(convexshape:fromposition:fromorientation:toposition:toorientation:query:mask:relativeto:).md)
- [pixelCast(from:to:)](realitykit/scene/pixelcast(from:to:).md)
- [pixelCast(origin:direction:length:)](realitykit/scene/pixelcast(origin:direction:length:).md)

### Synchronizing entities with other devices

- [synchronizationService](realitykit/scene/synchronizationservice.md)

### Publishing and subscribing to events

- [publisher(for:on:)](realitykit/scene/publisher(for:on:).md)
- [subscribe(to:on:_:)](realitykit/scene/subscribe(to:on:_:).md)
- [publisher(for:on:componentType:)](realitykit/scene/publisher(for:on:componenttype:).md)
- [subscribe(to:on:componentType:_:)](realitykit/scene/subscribe(to:on:componenttype:_:).md)

### Accessing the command queue

- [commandQueue](realitykit/scene/commandqueue.md)

### Structures

- [Scene.AnchorCollection](realitykit/scene/anchorcollection.md)
- [Scene.Publisher](realitykit/scene/publisher.md)

### Instance Properties

- [timebase](realitykit/scene/timebase.md)

### Default Implementations

- [Equatable Implementations](realitykit/scene/equatable-implementations.md)
- [Hashable Implementations](realitykit/scene/hashable-implementations.md)

## Relationships

### Conforms To

- [CoordinateSpace3D](spatial/coordinatespace3d.md)
- [CoordinateSpace3DFloat](spatial/coordinatespace3dfloat.md)
- [Copyable](swift/copyable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [EventSource](realitykit/eventsource.md)
- [Hashable](swift/hashable.md)
- [Identifiable](swift/identifiable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Scene management

- [Scene.AnchorCollection](realitykit/scene/anchorcollection.md)
