<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/GroundingShadowComponent/init(castsShadow:receivesShadow:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation24GroundingShadowComponentV05castsD008receivesD0ACSb_Sbtcfc"
  },
  "title" : "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.

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)