> For the complete documentation index, see [llms.txt](https://rsb.inanevin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rsb.inanevin.com/getting-started/incorporating-player/motion-controller.md).

# 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.
