# Motion Controller

If you continue looking down the hirarchy of the **Player Without Weapon** prefab, you will see a **Camera Animator** object. This is simply an example animator that animates a "camera-kick" effect when the player fires. Below that, we have **Camera Motion Controller** object, which has **MotionController.cs** component attached to it.

![MotionController.cs attached to the child object of Camera Animator, which is a child of Player Without Weapon prefab.](/files/-MaOT8PMPJDQAdk7SOkP)

This motion controller is the script that handles various effects to give life to the camera object.

* **BobMotion:** Bobs the camera with sine waves based on whether the player is walking or running.
* **Key & Mouse Sway:** Sways the camera's rotation based on keyboard & mouse input.
* **Recoil Motion:** Recoils camera when player fires.
* **Breath Sway:** When player aims, enables a sway effect mimicking player moving the weapon due to breathing. Player can hold **shift** to stabilize.
* **Positioner:** Can place the object to **hip, aim** or **running position,** based on whatever method is called. Is not being used in here, but will be used for weapon.

**BobMotion** and **Key\&Mouse Sway** works individually, one of them is based on player movement events coming from **PlayerMovementController.cs** and the other one is solely based on key\&mouse inputs. **Recoil Motion** requires you to call **Recoil()** method in **MotionController.cs**, same for using **BreathSway** and **Positioner** behaviors. Since our player prefab doesn't have a weapon now, these effects are enabled but there is no-one calling them.


---

# Agent Instructions: 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:

```
GET https://rsb.inanevin.com/getting-started/incorporating-player/motion-controller.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
