Camera Head Bob
Updated
Step bounce while the camera walks.
- Type
comp-camera-head-bob- Script class
CameraHeadBobEffectComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Camera 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 |
||
frequency |
||
fullSpeed |
||
rotation |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Poison makes the player dizzy, and the menu calms the cameraA first-person camera with Breathing, Head Bob and Dizzy effects: Poison and Cure play and stop the dizzy sway, and Open menu and Close menu switch the breathing and the walking bob off and on.
Walk with WASD to feel the head bob and drag to look around; press Poison to get dizzy, Cure to recover, Open menu to steady the view.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(CameraHeadBobEffectComponent); if (component) log(component.props);}