Skip to content

Fog

Updated

Distance fog over the whole scene.

Type
comp-fog
Script class
FogComponent
Per entity
One
Version
1.1.0

Read about it in Environment and sky: 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
density 0 ≤ x ≤ 10
far 0 ≤ x ≤ 100000
near 0 ≤ x < 100000

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(FogComponent);
if (component) log(component.props);
}