> For the complete documentation index, see [llms.txt](https://kinemation.gitbook.io/fps-animation-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinemation.gitbook.io/fps-animation-framework/tutorial/getting-started/controller-setup.md).

# Controller setup

## Add Character and FPS Controllers

First, add the standard Character Controller:

<figure><img src="/files/4sgK1pFxhPkqscRYG9Tc" alt="" width="446"><figcaption><p>You can use similar values.</p></figcaption></figure>

Now we need to add a demo project script - FPSController. It handles all the gameplay actions in the project.

### Turn In Place

Once you've added the **FPSController**, set up the Turn In Place feature first:

<figure><img src="/files/a2ndqjHoY0QhZPYiYYXn" alt="" width="422"><figcaption><p>Turn in place settings.</p></figcaption></figure>

The **Turn Curve** must be in range \[0;1], for both value and time:

<figure><img src="/files/qrMJAspG5AhQp1mmoR21" alt="" width="328"><figcaption><p>Turn curve.</p></figcaption></figure>

This curve will be used to procedurally rotate the character when it's time to turn.

### Smooth Leaning

Now we need to adjust the **Smooth Leanin**g - a game mechanic, which allows to control the leaning amount with the mouse wheel:

<figure><img src="/files/5y3WuBU3e9O61DrtRlEM" alt="" width="390"><figcaption><p>Smooth leaning settings.</p></figcaption></figure>

**Smooth Lean Step** defines the leaning sensitivity, and **Start Lean** defines the initial leaning amount in percents (1 means 100%, 0 means 0%).

### IK Animations/Poses

Now we need to set up the **IK Animation**:

<figure><img src="/files/DcTojnjanAco5Pa7CI1y" alt="" width="389"><figcaption><p>IK Transition motions.</p></figcaption></figure>

**IK Animation** is a Scriptable Object, which is applied procedurally and used as a transitions motion for aiming, leaning, crouching and jumping events:

<figure><img src="/files/yjWSRplXw9QYlCqhPznf" alt="" width="317"><figcaption><p>IK Animation example.</p></figcaption></figure>

**Rot and Loc** are animation curves for each rotation/translation axis

**Blend Speed** defines how fast we want to blend the motion in.

**Play Rate** defines the speed of the motion.

**Scale** is a global multiplier for the motion, and it's computed randomly in range \[X;Y].

Another IK feature used in the FPS Animation Framework is **IK Poses**. Unlike IK Animations, which are fire-and-forget type of thing, the IK Poses are mean to be used for different animation states.&#x20;

For example, let's say we don't like our pose when sprinting. We can create a new **IK Pose** for this animation state, and simply blend it in when we start sprinting:

<figure><img src="/files/dzIvqb5vHBlT2MlzLAMH" alt="" width="317"><figcaption><p>IK Pose example.</p></figcaption></figure>

**Pose** defines the additive offset for rotation/translation, and **Blend In/Out Speed** defines how fast we want to blend in/out.

<figure><img src="/files/NBFZum3FWcvEOZU3NEcE" alt="" width="392"><figcaption><p>You can assign IK Poses in FPSController/Animation tab.</p></figcaption></figure>

### Controller Settings

<figure><img src="/files/12wengpvbFI2B2T7qYAn" alt="" width="367"><figcaption><p>Controller tab settings.</p></figcaption></figure>

Now let's set up the Controller tab.

**Time Scale** allows you to add a slow motion effect, if less than 1.

**Equip Delay** defines the timer length for the wepaon equip action. We don't rely on the animation events, instead we set a timer when we start equipping another weapon.

Assign **Main Camera**, **Camera Holder** and **First Person Camera** objects using the references from the [Camera setup](/fps-animation-framework/tutorial/getting-started/camera-setup.md) step. (Edit: **First Person Camera** is the FPCameraSocket).

Finally we have a Movement Component reference, which we will deal with in the next chapter.

## Movement Component

All movement logic is handled in the **FPSMovement.cs** script. Add this component directly to your character and assign its reference in the **FPSController**/Controller tab.

Let's take at the inspector:

<figure><img src="/files/blpfFgjN93pQFxOQGF3W" alt="" width="383"><figcaption><p>FPSMovement component.</p></figcaption></figure>

Use the **rootBone** GameObject in the skeleton hierarchy and assign it to the respective property.

**Movement Settings** is a Scriptable Object, which contains all the necessary settings for different movement states:

<figure><img src="/files/YbPwVb90Mcf6PIEqjZOW" alt="" width="380"><figcaption><p>You can find it in the Assets/Demo/DataAssets.</p></figcaption></figure>

**Idle, Prone, Crouching and others** contain a Velocity (defines the movement speed) and Velocity Smoothing (how responsive the state should be. If zero - no smoothing applied).

**Crouch Ratio** is a multiplier for the capsule height when crouching.

**Jump Height** defines how high we want to jump.

**Air Friction/Velocity** represent the responsiveness and movement speed when in air.

**Max Fall Velocity** will be used to clamp the gravity.

**Slide Curve** defines how sliding will be applied.

**Slide Dircetion Smoothing** defines the responsiveness when sliding.

**Slide Speed** defines the sliding velocity.

At this point we've completeted the character setup. We will learn how to set up a weapon from scratch in the next section.
