Learn how the Shadow Caster 2D component defines the shape and properties that a light uses to determine its cast shadows.
Add the Shadow Caster 2D component to a GameObject by going to Component > Rendering > 2D > Shadow Caster 2D.
| Property | Description |
|---|---|
| Casting Source | Sets the source for the shape of the shadows. The options are the following:
|
| Casting Option | Sets how the GameObject casts shadows. The options are the following:
|
| Target Sorting Layers | Applies the shadows to these sorting layers. The options are the following:
|
The Composite Shadow Caster 2D component merges the shape of multiple Shadow Caster 2D components together as a single shadow caster 2D.
To use a Composite Shadow Caster 2D component, do the following:
To add a Composite Shadow Caster 2D component to a GameObject, go to Component > Rendering > 2D > Composite Shadow Caster 2D.
Add GameObjects with the Shadow Caster 2D component as children of the GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary from step 1.
The Composite Shadow Caster 2D component merges all Shadow Caster 2D components within this hierarchy, including any Shadow Caster 2D components on the parent.