Ambient Light
Updated
Even light from everywhere, with no direction or shadows.
- Type
comp-ambient-light- Script class
AmbientLightComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Lights: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
intensity |
0 ≤ x ≤ 100 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
AmbientLight::change
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Lights and shadowsA sun and an ambient fill light the scene, and a teal point light with a real-time shadow map circles the objects, so their shadows move with it. Each object casts and receives through its Shadow component.
Watch the shadows follow the teal light as it circles. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AmbientLightComponent); if (component) log(component.props);}