<XrFollow>
Keeps what it wraps in view: a HUD, a status card, a menu that should never get lost behind the user. It sits in front of the viewer and turns to face them. Lazy by default, like the Quest system UI: it stays put while you look around a little and glides back once it drifts more than angle degrees from where you look.
Usage
vue
<XrFollow :distance="0.8" :height="-0.15">
<XrPanel :width="320">
<XrText>Recording…</XrText>
</XrPanel>
</XrFollow>- Children are placed relative to the follow point, so a panel inside needs no
position. - It follows turns and steps but not nods: it stays level, at
heightmetres from your eyes. :angle="0"follows every turn, smoothed (a head-locked HUD). Use it sparingly: content glued to the head is tiring.:active="false"pins it where it is; bind it to a toggle so the user can leave the panel in a spot.- It jumps straight in front when a session starts or ends and when the user recentres.
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
distance | number | 0.8 | Distance in front of the viewer, in metres. |
height | number | -0.1 | Height relative to the viewer's eyes, in metres (negative is below). |
active | boolean | true | Follow the viewer. false leaves it where it is (pinned). |
angle | number | 30 | How far, in degrees, the content may drift from straight ahead before it follows. 0 follows every turn (a head-locked HUD, but smoothed). |
speed | number | 4 | How fast it catches up: the share of the remaining way covered per second, as an exponential rate. With reduced motion (useXrReducedMotion) it jumps instead. |
face | boolean | true | Turn to face the viewer (around the vertical axis). |
Events
| Event | Payload | Description |
|---|---|---|
follow | It started moving back in front of the viewer. | |
settle | It arrived and stopped. |