Fire
Updated
A particle flame; many fires share one draw call.
- Type
comp-fire- Script class
FireComponent- Per entity
- One
- Version
- 1.2.0
Read about it in Fire: 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 |
|---|---|---|
height |
0 ≤ x ≤ 100 |
|
particleCount |
0 ≤ x ≤ 2048, integer |
|
radius |
0 ≤ x ≤ 100 |
|
seed |
||
size |
0 ≤ x ≤ 10 |
|
speed |
-10 ≤ x ≤ 10 |
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 fire that burns down unless fedA campfire loses fuel every second and shrinks with it, throttled to four prop changes a second; Add wood feeds it, and an empty fire switches off until fed again.
Watch the fire shrink, then press Add wood to feed it; let it run out and it goes dark until you add more. 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(FireComponent); if (component) log(component.props);}