---
title: SpotLight
framework: realitykit
role: symbol
role_heading: Class
path: realitykit/spotlight
---

# SpotLight

An entity that illuminates virtual content in a cone-shaped volume.

## Declaration

```swift
@MainActor @preconcurrency class SpotLight
```

## Overview

Overview During an AR session, RealityKit automatically lights your virtual objects to match real-world lighting. You can also explicitly add virtual lights that act upon your virtual content. This is typically most useful outside of an AR session on iOS or macOS, where your RealityViewCameraContent camera property is set to virtual. A RealityKit scene can contain up to eight dynamic lights, which are entities that contain a SpotLightComponent, PointLightComponent, or a DirectionalLightComponent. This limit doesn’t include light from image-based lighting.

## Topics

### Creating a spotlight

- [init()](realitykit/spotlight/init().md)

## Relationships

### Inherits From

- [Entity](realitykit/entity.md)

### Conforms To

- [CoordinateSpace3D](spatial/coordinatespace3d.md)
- [CoordinateSpace3DFloat](spatial/coordinatespace3dfloat.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Equatable](swift/equatable.md)
- [EventSource](realitykit/eventsource.md)
- [HasHierarchy](realitykit/hashierarchy.md)
- [HasSpotLight](realitykit/hasspotlight.md)
- [HasSynchronization](realitykit/hassynchronization.md)
- [HasTransform](realitykit/hastransform.md)
- [Hashable](swift/hashable.md)
- [Identifiable](swift/identifiable.md)
- [Observable](observation/observable.md)
- [RealityCoordinateSpace](realitykit/realitycoordinatespace.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Entity compliance

- [HasPerspectiveCamera](realitykit/hasperspectivecamera.md)
- [PointLight](realitykit/pointlight.md)
- [HasPointLight](realitykit/haspointlight.md)
- [HasSpotLight](realitykit/hasspotlight.md)
- [DirectionalLight](realitykit/directionallight.md)
- [HasDirectionalLight](realitykit/hasdirectionallight.md)
