---
title: SpotLightComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/spotlightcomponent
---

# SpotLightComponent

A component that defines a spotlight source.

## Declaration

```swift
struct SpotLightComponent
```

## Mentioned in

Automatically animating RealityKit entities

## Overview

Overview A spotlight illuminates a cone-shaped volume in the entity’s local forward direction along the z-axis’s negative direction, or [0.0, 0.0, -1.0]. Change the a spotlight’s direction with the Entity/orientation or look(at:from:upVector:relativeTo:) method, of the Entity with a spotlight component. The light’s innerAngleInDegrees and outerAngleInDegrees reflect the size of the light’s cone relative to the entity’s forward direction. The light is at full intensity between 0 degrees and innerAngleInDegrees. RealityKit attenuates the light’s intensity between the inner angle and the outer angle. The spotlight’s intensity is 0.0 beyond the outer angle. tip: Turn on shadows for a spotlight by adding the SpotLightComponent.Shadow component to an entity that has a SpotLightComponent. The following table shows some real-world scenarios, to better explain how you can use intensity to control the brightness of the light in lumens, and attenuationRadius to control how the level of brightness diminishes with distance from the light source:  |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |

## Topics

### Configuring the spotlight

- [intensity](realitykit/spotlightcomponent/intensity.md)
- [innerAngleInDegrees](realitykit/spotlightcomponent/innerangleindegrees.md)
- [outerAngleInDegrees](realitykit/spotlightcomponent/outerangleindegrees.md)
- [attenuationRadius](realitykit/spotlightcomponent/attenuationradius.md)
- [attenuationFalloffExponent](realitykit/spotlightcomponent/attenuationfalloffexponent.md)

### Supporting types

- [SpotLightComponent.Color](realitykit/spotlightcomponent/color-swift.typealias.md)

### Specifying the render layers

- [layers](realitykit/spotlightcomponent/layers.md)

### Defining the light contribution

- [SpotLightComponent.SurroundingsLight](realitykit/spotlightcomponent/surroundingslight.md)
- [SpotLightComponent.ProjectiveTexture](realitykit/spotlightcomponent/projectivetexture.md)

### Structures

- [SpotLightComponent.Shadow](realitykit/spotlightcomponent/shadow.md)

### Initializers

- [init(color:intensity:innerAngleInDegrees:outerAngleInDegrees:attenuationRadius:)](realitykit/spotlightcomponent/init(color:intensity:innerangleindegrees:outerangleindegrees:attenuationradius:).md)
- [init(color:intensity:innerAngleInDegrees:outerAngleInDegrees:attenuationRadius:attenuationFalloffExponent:)](realitykit/spotlightcomponent/init(color:intensity:innerangleindegrees:outerangleindegrees:attenuationradius:attenuationfalloffexponent:).md)

### Instance Properties

- [color](realitykit/spotlightcomponent/color-2o8ve.md)
- [color](realitykit/spotlightcomponent/color-6enoj.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)
- [Copyable](swift/copyable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)

## See Also

### Spotlights and their shadows

- [SpotLightComponent.Shadow](realitykit/spotlightcomponent/shadow.md)
- [SpotLightComponent.Shadow.ShadowClippingPlane](realitykit/spotlightcomponent/shadow/shadowclippingplane.md)
- [SpotLightComponent.Shadow.ShadowMapCullMode](realitykit/spotlightcomponent/shadow/shadowmapcullmode.md)
