Shock Wave Effect
Updated
A ring that ripples the image outward from a world point, like a blast, set off by a script.
- Type
comp-shock-wave-effect- Script class
ShockWaveEffectComponent- 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 |
|---|---|---|
amplitude |
0.05 |
- |
maxRadius |
1 |
0 ≤ x ≤ 10 |
position |
[0,0,0] |
|
position.0 |
||
position.1 |
||
position.2 |
||
speed |
2 |
0 ≤ x ≤ 10 |
waveSize |
0.2 |
0.001 ≤ 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
Set off a shock wave where something explodesClick a barrel and it disappears in a shock wave that ripples across the screen from where it stood: a Shock Wave effect on the camera, played by a Behavior script from Selectable clicks.
Click the barrels one by one. Reload to bring them back. 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(ShockWaveEffectComponent); if (component) log(component.props);}