Environment
Updated
Lights the scene with an HDRI and shows it as the sky.
- Type
comp-environment- Script class
EnvironmentComponent- Per entity
- One
- Version
- 2.1.0
Read about it in Environment and sky: 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 |
|---|---|---|
background |
0 ≤ x ≤ 1 |
|
background |
0 ≤ x ≤ 100 |
|
intensity |
0 ≤ x ≤ 100 |
|
rotation |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Turn and soften the environmentAn outdoor HDRI lights a set of statues and shows as the sky; at start the script turns it 90 degrees, blurs and dims the backdrop and softens the lighting, all on the scene root's Environment.
Orbit around the chrome and amber statues to see the HDRI reflected in them, behind its softened backdrop. 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(EnvironmentComponent); if (component) log(component.props);}