# Recentering for Daydream apps in Unity

## Orientation and movement types

Daydream apps usually have one of the following types of visual orientation:

- **Natural forward direction**
  Example: Daydream Home environment that you see when you press the home button.

- **Visual exploration in any direction** (360° experience apps)
  Example: An open environment that lets you point your gaze in any direction.

Default recentering behavior reorients the Daydream controller and the user's
visual orientation in VR. Controller recentering is useful in either type of
app. However, 360° experience apps must preserve the user's orientation on
recenter.

## Default recentering behavior

Default recentering behavior is designed for apps with a natural forward
direction. It lets users reorient themselves in VR and compensate for certain
types of sensor drift.

Users can long-press the Daydream controller "home" button to:

- **Reorient the controller** so that it points directly in front of the user.

- **Reorient the virtual camera** so that the scene's natural forward
  direction is directly in front of the user.

## 360° experience apps

Controller recentering should be provided in every Daydream app.
However, apps with a 360° environment and no natural forward direction
**must** preserve the user's visual orientation on recentering design
requirement
[UX-D6](https://developers.google.com/vr/distribute/daydream/design-requirements#UX-D6)

To prevent headset re-centering in 360˚ experience apps, add the
[GvrRecenterOnlyController](https://github.com/googlevr/gvr-unity-sdk/blob/master/Assets/GoogleVR/Scripts/Controller/GvrRecenterOnlyController.cs)
script to a game object in your scene.
This script counteracts the built-in rotation adjustment by
making an equal and opposite adjustment to the Daydream pointer and the parent
of the camera.
Apps with a natural forward direction should not use this script.

Developers of 360˚ experience apps can also use the
[ReorientOnLoad](https://github.com/googlevr/daydream-elements/blob/master/Assets/DaydreamElements/Common/Scripts/Utility/ReorientOnLoad.cs)
script to orient the user correctly on entering a scene regardless of their
previous orientation.