Night Sky
Updated
Night sky with stars, Milky Way, moon and shooting stars.
- Type
comp-night-sky- Script class
NightSkyComponent- 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 |
|---|---|---|
exposure |
0 ≤ x ≤ 100 |
|
moonAzimuth |
||
moonElevation |
||
moonPhase |
||
nebulaDrift |
- |
|
preset |
"pristine |
|
seed |
||
starCount |
0 ≤ x ≤ 100000, integer |
|
starDensity |
0 ≤ x ≤ 2 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A moonlit night with more stars over timeA full-moon night sky whose stars come out over twenty seconds, with a directional light aimed at the moon: a Night Sky on the scene root driven by a Behavior script.
Watch the stars come out, then look up at the moon. 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(NightSkyComponent); if (component) log(component.props);}