# 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.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNvVqmR0PSBBSvny79%2F-MaOT8PMPJDQAdk7SOkP%2Fimage.png?alt=media\&token=1971f3f7-5987-4380-8f0f-cfaadb6fa232)

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.
