> For the complete documentation index, see [llms.txt](https://xreal.gitbook.io/nrsdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xreal.gitbook.io/nrsdk/development/miscellaneous/reset-camera.md).

# Reset Camera

### Introduction

If you're building a seated or standing experience, you can recenter Unity's world origin at the user's current position and orientation by calling the API `NRHMDPoseTracker.ResetWorldMatrix` . The **HelloMR-ResetCamera** sample scene demonstrates how to reset the camera with this API in an app.&#x20;

The main script is `CameraResetController.cs` which uses a boolean to support reset camera with pitch as well.

### Developer Guide

1. Create a new project in Unity with NRSDK. Refer to [Getting Started with NRSDK](/nrsdk/nrsdk-fundamentals/quickstart-for-android.md) for more setting up instructions.
2. Create a canvas and a button;
3. Drag the script CameraSmoothFollow\.cs to the inspector of canvas for sticking the menu in your view so you can click your reset button easily. You can adjust the speed of the button moving with your view with `Follow Speed`.                   ![](/files/PdyS8r3zD6aXRIJ21lG4)
4. Drag the script CameraResetController.cs and CanvasRaycastTarget.cs to the inspector of canvas;
5. Set the OnClick() event of your button, drag the canvas to the event;![](/files/LW0eK4WKoTRFQFwYisjh)
6. Choose the function `CameraResetController` -> `ResetCameraToOrigin(bool)`![](/files/nV1pVLm0HLmrIvJM7GgU)
7. That's it. You can build your app and test the recenter effect. If you want to reset the camera with pitch, just repeat the upper steps and choose the check box.  ![](/files/gBuAVoWcBLoEkM2K9INI)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xreal.gitbook.io/nrsdk/development/miscellaneous/reset-camera.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
