---
title: DynamicLightShadowComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/dynamiclightshadowcomponent
---

# DynamicLightShadowComponent

A component that controls an entity’s shadow from dynamic (virtual) lights.

## Declaration

```swift
struct DynamicLightShadowComponent
```

## Overview

Overview Use DynamicLightShadowComponent to control whether an entity casts shadows from dynamic (virtual) lights. Dynamic lights cast shadows on other virtual objects, but not on physical objects. You can add a dynamic light shadow component to any entity that has a ModelComponent in its component set by adding a dynamic light shadow component to the entity’s components property. if let model = try? await ModelEntity(named: "tv_retro") {     let shadowComponent = DynamicLightShadowComponent(castsShadow: false)     model.components.set(shadowComponent) } You need to add the dynamic lights shadow component to each entity you want to apply the effect to because the dynamic light shadow component doesn’t apply to hierarchies. note: By default, without a dynamic light shadow component, entities cast shadows from dynamic lights.

## Topics

### Initializers

- [init(castsShadow:)](realitykit/dynamiclightshadowcomponent/init(castsshadow:).md)

### Instance Properties

- [castsShadow](realitykit/dynamiclightshadowcomponent/castsshadow.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)

## See Also

### General shadows

- [GroundingShadowComponent](realitykit/groundingshadowcomponent.md)
