Poison makes the player dizzy, and the menu calms the camera
Updated
A 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.
Poison makes the player dizzy, and the menu calms the camera
#pragma lifecycle(startup)
function startup() { const cam = self; // on the player's camera const dizzy = cam.getComponent(CameraDizzyEffectComponent); const breathing = cam.getComponent(CameraBreathingEffectComponent); const headBob = cam.getComponent(CameraHeadBobEffectComponent);
on('player/poisoned', () => dizzy.play(0.6)); on('player/cured', () => dizzy.stop());
on('menu/open', () => { breathing.setEnabled(false); headBob.setEnabled(false); }); on('menu/close', () => { breathing.setEnabled(true); headBob.setEnabled(true); });}How it works
Section titled “How it works”The script is explained step by step in Poison makes the player dizzy, and the menu calms the camera.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
StatusEffects.xrproj