---
title: "init(castsShadow:receivesShadow:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/groundingshadowcomponent/init(castsshadow:receivesshadow:)"
---

# init(castsShadow:receivesShadow:)

Creates a grounding shadow component by configuring whether its entity receives shadows from other model entities with the component.

## Declaration

```swift
init(castsShadow: Bool, receivesShadow: Bool)
```

## Parameters

- `castsShadow`: A Boolean value that indicates whether the component’s entity casts a shadow on the environment and other model entities.
- `receivesShadow`: A Boolean value that indicates whether the component’s entity receives shadows from other model entities.

## Discussion

Discussion This initializer is an alternative to init(castsShadow:), which creates a component that, by default, configures an entity to receive grounding shadows from other model entities in the scene.
