Lens Drops Effect
Updated
Raindrops on the camera lens that land, slide down and dry off.
- Type
comp-lens-drops-effect- Script class
LensDropsEffectComponent- Per entity
- One
- Version
- 1.3.0
Read about it in Light and lens effects: 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 |
|---|---|---|
advance |
0 |
0 ≤ x ≤ 60 |
cling |
1 |
0 ≤ x ≤ 5 |
count |
40 |
0 ≤ x ≤ 1000, integer |
duration |
10 |
0 ≤ x ≤ 60 |
evaporation |
6 |
0.1 ≤ x ≤ 30 |
gravity |
1 |
0 ≤ x ≤ 10 |
rate |
20 |
0 ≤ x ≤ 100 |
size |
0.03 |
0. |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Rain on the lens during a stormA storm wets the camera lens and its end lets the drops dry: a Lens Drops effect kept enabled and wiped at start, driven by Storm, End storm and Wipe buttons.
Press Storm to start the rain on the lens, Wipe to clear it at once, End storm to let it dry. 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(LensDropsEffectComponent); if (component) log(component.props);}