Skip to content

Light Shadow

Updated

Adds real-time and baked shadows to the light beside it.

Type
comp-light-shadow
Script class
LightShadowComponent
Per entity
One
Version
1.1.0

Read about it in Shadows: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
bias
mapSize 1 ≤ x ≤ 2048, integer
radius 0 ≤ x ≤ 16
range 0 ≤ x ≤ 1000

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • LightShadow::change

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(LightShadowComponent);
if (component) log(component.props);
}