# Getting Started

Hello and welcome!

Thank you so much for buying Motion! We can't wait to get you started so let's just dive right into it!

### Adding Motion to a project <a href="#create-a-project-with-motion" id="create-a-project-with-motion"></a>

To create a project with Motion, open the Epic Games Launcher and head to your Library.

Scroll down to your Vault and locate Motion by scrolling down or typing Motion into the search bar.

Click "Add to Project", and select the project you wish to add Motion to.

Opening your project, if you can see a `EpicGames` and `Motion` folder in your content browser, you have successfully added Motion to your project!

![](/files/DHGkQ0cRNbaYO6Ej8CXN)

### Default Controls[​](https://docs.regensturm.com/motion/1.4.0.0/#default-controls) <a href="#default-controls" id="default-controls"></a>

The controls for Motion are as follows:

![](/files/8eSSUSJAiGWwB6BPLPyZ)![](/files/TwmLXfnbJPQlxjy9lMKJ)

### Enable required plugins[​](https://docs.regensturm.com/motion/1.4.0.0/#enable-required-plugins)

Motion makes use of the `Animation Locomotion Library`, `Animation Warping`, `Enhanced Input` and `MetaSound` plugins that ship with UE5. In order to use Motion in a project, it is required to enable a set of plugins to ensure all features work properly.

To do so, open the Plugins tab from the Settings dropdown.

![](/files/ieiASJh27o1i3KQeJxsq)

Then find the following plugins, enable them by clicking the checkbox and restart the Unreal Editor.

* Animation Locomotion Library
* Animation Warping
* MetaSound
* Enhanced Input

<mark style="color:blue;">Note: Depending on the version of Unreal Engine you use, some of these plugins may not exist anymore as they are part of the engine now. In that case, you do not need to enable them.</mark>

Now, head to your `Project Settings`, go to `Input` (under Engine) and update the default classes to the new Enhanced variants.

<figure><img src="/files/sEec1ALtEoR9Q0a6EuA5" alt=""><figcaption></figcaption></figure>

#### Setting up your Game Mode[​](https://docs.regensturm.com/motion/1.4.0.0/#setting-up-your-game-mode) <a href="#setting-up-your-game-mode" id="setting-up-your-game-mode"></a>

**CAUTION**

<mark style="color:orange;">This section is only for users who wish to use Motion in an existing project.</mark>

In order for Unreal Engine to load the Motion character blueprint we need to either adjust your existing game mode blueprint to point to Motion or set up your project to use the provided game mode from Motion.

If you want to use the provided `BP_MotionGameMode`, open your project settings

![](/files/XFZFxHepVf6wBHGO5Lse)

head to the `Maps & Modes` section

![](/files/pn4oFFRqi3NWUQGeqxHr)

and select `BP_MotionGameMode`.

![](/files/UqbbPTRO3JQE7KtuR2zy)

If you press `Play` or `Alt + P` your character should now be using the provided Motion character.

You can verify this by two options we leave enabled by default.

First thing you will see is a `crosshair` in form of a dot in the center of your viewport.

![](/files/UVimgh5h0tnaEvUgHEQM)

**Congratulations!** You have successfully installed Motion to your project!

To learn more about each component that comes with Motion, check out the pages you can find in the `Components` section of the sidebar to your left.


# Add Footsteps to Motion

This section explains how to import your own sounds to Unreal Engine and how to add them to Motion.

### Importing Sounds

Browse to a folder of your choice in the Content Explorer. We recommend `Motion\Sounds`.

<figure><img src="/files/g2moOj6RURFKMFSuxIjA" alt=""><figcaption></figcaption></figure>

Press the green `Add/Import` button and select `Import to..` at the top.

<div align="left"><figure><img src="/files/l8G8ijZVVZGwNzMQTPtW" alt=""><figcaption></figcaption></figure></div>

Browse to the audio file you want to import and select it by double-clicking it and pressing the `Open` button in the bottom right of the dialog.

<mark style="color:blue;">Unreal Engine currently supports importing uncompressed little endian 16 bit wave files at any sample rate (although sample rates of 44100 Hz or 22050 Hz are recommended).</mark>

![](/files/BbfTqTFWfxfpaiytG3IH)

If imported successfully, you will see a new item in your Content Browser.

![](/files/nGhkrOYiS6JfZdhYx5RH)

The imported sound will be imported as `Sound Wave`. Motion requires sound assets to be a `Sound Cue`. In the next step we will create a sound cue.

### Creating Sound Cues

To create a `Sound Cue`, right-click a Sound Wave and select `Create Cue`.

![](/files/JobL2XOxQVbIBh0oufSL)

If successful, you will find a Sound cue in the Content Browser.

![](/files/XXjQdz6PRLWWKflCqbcc)

Next, we will add the sound cue to Motion.

### Add Sound Cues to Motion

There are multiple scenarios that we are going to cover in this part of the tutorial.

#### Add Sounds to existing Meta Sound Source

If you want to add a new sound file to an existing movement sound (e.g. walking on Gravel), open the respective Meta Sound Source located in `Motion\Sounds\MetaSounds`.

Then find the `Input` node and click on it.

![](/files/YR5dvNHIn4vR86kbsYvw)

On the left-hand side, in the Details tab, you will find the `Sounds` array which holds all the sound cues that are used in this Meta Sound Source. Add your newly created sound cue to the array to have it in the list of randomly chosen sounds for this sound source.

![](/files/pgoSUyZtAk92fnJygbOy)

#### Create a new Meta Sound Source

If none of the existing sources fit where your new sound belongs to, you can easily create a new sound source.

We recommend cloning an existing source and replacing the content of the `Sounds` array if you simply want to add sounds for a new surface.

Right-click any existing sound source (except for MSS\_MotionBase) and click `Duplicate`. Then double-click, locate the `Input` node, click it, and modify the content of the array.

Then, head make a new entry in the sounds table, as described on the Movement Sounds page.


# Add Surfaces to Motion

Please refer to the official [Unreal Engine documentation](https://docs.unrealengine.com/en-US/InteractiveExperiences/Physics/PhysicalMaterials/HowTo/AddSurfaceType/index.html) regarding Surface types.


# Camera Transitions

This page explains how the new camera curve transitions work and how you can utilize them to create a more immersive gameplay experience.

### Transition Functionality

A camera curve transition is initiated by calling `Start Transition` on the BP\_CharacterCurveManager. It requires you to provide a source and target curve. The reason for why Motion does not automatically find the curve used by a component is that a component could be using more than one curve.

![](/files/ry9FR6ayGNFzANcBZX7V)

#### FStructMotionCurveTransitionConfiguration

The FStructMotionCurveTransitionConfiguration contains all the information the Curve Manager needs.

Both the `Identifier` and `Target Identifier` describe a FStructMotionCurveIdentifier, containing the component that transitions and the curves used to transition from and to.

The `Transition Time` describes the time in seconds Motion should take to transition from the source to the target curve. If you want a sudden, but smooth change in curves, a lower number is recommended.

The `Tick Rate` should be left at 1.0.

#### Transition Progress

After a transition has started, a series of events occur:

1. The Transition is being added to the active transitions array of the curve manager.
2. The source curve gets the `bIsTransitioning` flag.
3. A new camera curve gets created, using the target curve vector & current rotation, and the source curve's FStructMotionCurveConfiguration, at Tick rate 0.

While the Active Seconds of the transitions have not reached the `Transition Time`

* The source curve's rotation target is set to 0 and is being slowly lerped towards to.
* The transitions active seconds are updated.
* Transition Events (OnTransitionMinimum, OnTransitionUpdate) are called.
* The target curve's tickrate is slowly increased from 0 to 1, depending on the `Transition Time`.

When the transition time has been reached:

* `OnTransitionMaximum` gets called, executing the default behaviour in BP\_BaseCharacterCurvedComponent.
* It deletes the transition and the source curve.
* Removes the old curve's camera offset.
* And finally deletes the old curve from the curve manager's array.

It is important that the old curve's rotation information is kept until the transition has finished to ensure that there is no sudden camera twitches.


# Creating a component

This page explains how to create a new component for Motion to extend Motion to your needs. In this example we will create a *Health Component* which adds a Health value to the Motion Character which we can then use to implement **fall damage**.

### Creating a Motion Component

To begin, we need to create a new [Actor Component](https://docs.unrealengine.com/en-US/API/Runtime/Engine/Components/UActorComponent/index.html) by right-clicking in the [Content Browser](https://docs.unrealengine.com/en-US/Basics/ContentBrowser/index.html) and selecting **Blueprint Class**.

<figure><img src="/files/T4Sg9n7sc818QZ2fKxCH" alt=""><figcaption></figcaption></figure>

In the modal that opens, scroll down and select **BP\_BaseCharacterCurvedComponent**.

<figure><img src="/files/Zq42H9kAJ2Cp9WWlF7jM" alt=""><figcaption></figcaption></figure>

Name it **BP\_HealthComponent**.

![](/files/ytKXJlKWaxA9codqXLJH)

Double-clicking it will show you the empty [Event Graph](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/EventGraph/index.html).

<figure><img src="/files/p2WgdyTg9eAZhJyIphqf" alt=""><figcaption></figcaption></figure>

### Listening to Event Landed

Since the Character Blueprint already comes with a [Event Dispatcher](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/EventDispatcher/index.html) for `OnPlayerLanded` we can just subscribe to that!

To do so, get the `Character Core Component` and from there the `Character`. Drag the `Character` reference, create a `Bind Event to On Player Landed` node and createa a new custom Event to it.

Then create a new function named `HandleOnPlayerLanded`. Inside this function we will place the code that is executed when the event fires.

Connect it to the `EventOnPlayerLanded` node.

### Testing the Event Handler

Now our component is ready for testing! To test if our Event Handler is actually called, add a `Print String` node inside of `Handle on Player Landed`.

![](/files/BYQj60jdQj0N4e7Rsc6y)

### Adding Component to Character

For our new component to run we simply need to add it to our Character Blueprint. Open `BP_MotionCharacter`, press `Add Component` in the Components tab, search for the new Health Component and select it.

That's it already! Now to test if the previously added `Print String` node is actually called, hit the Play button in your editor's toolbar and jump. When landing, a message should appear on your screen.

### Adding simple damage logic

This example will only cover a simple example solution for damage. Feel free to adjust and extended the logic as needed for your project.

Add a variable of Type `Float` and name it `Health`. Set it's default value to 100 in the `Details` tab and then replace the code inside of `Handle on Player Landed` with the following code:

<figure><img src="/files/HX8xjw0AnEd9BUWIvscl" alt=""><figcaption></figcaption></figure>

Create a new variable of Type `Boolean` called `bShowDebugInformation`. Set it\`s default value to `True` and create a new function `Print Debug Information` and add the following code:

<figure><img src="/files/SrGJ4vYtLsBd3pvHi9zc" alt=""><figcaption></figcaption></figure>

Then call it in `Event Tick` as follows:

<figure><img src="/files/4FjcNS8wPxVXq08Mtvcz" alt=""><figcaption></figcaption></figure>

Hit the Play button in your editor's toolbar again and it should look like this now when you jump and land:

You have successfully created a component for Motion! Congratulations!


# Retargeting Marketplace Characters

In this tutorial we are going to explain how to retarget / adjust a character purchased from the Unreal Engine Marketplace to function with Motion.

<mark style="color:blue;">Motion makes use of the UE5 Metarig as demonstrated and used in the Lyra Sample Game. All changes you will find in the Lyra sample game also apply to Motion.</mark>

<mark style="color:orange;">At this point, we recommend using a seperate branch in your VCS or making a backup before continuing.</mark>

### Retargeting a UE4 Character

In this scenario we will cover retargeting a UE4 character from the marketplace to work with Motion. We will use the [Gothic Knight](https://unrealengine.com/marketplace/en-US/product/gothic-knight) asset as example character, as it has not been updated to UE5 at the time of writing.

#### Create Animation Blueprint for Mesh

To get started, create an animation blueprint for the skeletal mesh you intend to use by right-clicking, and selecting `Create -> Anim Blueprint`.

<figure><img src="/files/8yvv6RAsuXSkF517FbZA" alt=""><figcaption></figcaption></figure>

In this case it's called `SK_GothicKnight_Skeleton_AnimBlueprint`. Open the Animation Blueprint by double-clicking it.

#### Add Animation Blueprint Logic

Unlike Retargeting in Unreal Engine 4, retargeting the skeletal mesh to use the UE5 skeleton is not neccessary. Instead, we instruct the animation blueprint to copy the pose of it's parent mesh using a `IK Retargeter`.

<mark style="color:blue;">The IK Retargeter used here are also included in the Third Person Starter Pack that ships with Unreal Engine 5.</mark>

In the AnimGraph of the Animation Blueprint, create a new `Retarget Pose From Mesh` node and connect it to the Output Pose.

<figure><img src="/files/KKC2iSRrxfdShfIFiJws" alt=""><figcaption></figcaption></figure>

Click the newly created node and go to the Details tab. There, select `RTG_UE5Manny_UE4Manny` in the `IKRetargeter Asset` dropdown.

<figure><img src="/files/veW1Hy7PVrjWldaWIu3Q" alt=""><figcaption></figcaption></figure>

That's it! You successfully created the retargeting animation blueprint for your character mesh. Now, let's add it to Motion.

#### Adding your Mesh to the Motion Character

Open your `BP_MotionCharacter` and head over to the Components tab.

Select the `FullBody` skeletal mesh and, on the details tab, change the skeletal mesh to your new mesh.

Then, change the `Anim Class` property above to be the animation blueprint you created earlier in this tutorial.

<figure><img src="/files/HD6eMhOgFPEPGRDLzDDZ" alt=""><figcaption></figcaption></figure>

Repeat the same process for the `Headless` skeletal mesh.

#### Result

Starting a Play-in-Editor session should now result in your new character being shown, with the mannequin being invisible and all animations being applied to the new mesh.


# Using Metahumans

This page explains how to add a Metahuman to your Motion project and integrate them into the Motion character blueprint.

### Importing your MetaHuman

To import your MetaHuman, open the `Quixel Bridge` window inside the editor which you can find in the `Window` toolbar menu.

![](/files/haGz92HLXsmzVPWfvwCT)

Select your MetaHuman then download & import it.

![](/files/13igAM8jEu0nprk8mltF)![](/files/iB6DgEhzMT4DJ9cXgSu6)

Make sure to modify your project settings when prompted by confirming dialog boxes that show up upon first importing a MetaHuman into your project and then restart Unreal Engine.

<figure><img src="/files/4NGLekVnjhPxxrmJu8p7" alt=""><figcaption></figcaption></figure>

Once successfully imported, you'll find your MetaHuman, alongside other common assets used by MetaHumans in your project.

<figure><img src="/files/MpNPDkyZMVGl6NOCNBe9" alt=""><figcaption></figcaption></figure>

### Adding the MetaHuman to your Motion Character Blueprint

Alongside the blueprint of the MetaHuman, open your Motion character blueprint.

Select the shown components from your MetaHuman blueprint and hit CTRL + C or right-click "Copy" to copy the components.

![](/files/5rmWDMojhYYI1kDCyJJD)

Then, in the Motion character blueprint, paste them as children of `Mesh`.

Move the components to their respective parents if the copy-paste-process messed up their hierarchy.

<figure><img src="/files/KAzOGpMlvtdIASvywJkL" alt=""><figcaption></figcaption></figure>

Finally, copy the `LODSync` component from the MetaHuman blueprint into your Motion character blueprint.

![](/files/eRyHDNYUd1O8Tw8IML2q)

#### Copy MetaHuman Blueprint Logic

#### Functions

MetaHumans require some setup upon start, so we need to copy that code from the MetaHuman blueprint into the Motion character blueprint.

Copy the following functions from the Metahuman blueprint and paste them in the Motion blueprint.

1. EnableMasterPose
2. ARKit\_Setup

<mark style="color:blue;">The ARKit Setup is optional.</mark>

#### Event Graph

Head to the `Event Graph` of the Motion character blueprint and create a new function and name it `Initialize MetaHuman`.

![](/files/VZTDpzEobuP4iJmtHFgv)

Then, head back to the MetaHuman blueprint, and copy all nodes from it's Event Graph. Paste them into the function.

<figure><img src="/files/8EIpqRDDseqjhz4CmfaB" alt=""><figcaption></figcaption></figure>

Back in the `Event Graph` of the Motion character blueprint, add a call to `Initialize Metahuman` to the `Event Begin Play` sequence.

<figure><img src="/files/KMMFHvZnWjgUAngtzNZd" alt=""><figcaption></figcaption></figure>

#### Construction Script

Open the `Construction Script` of the Motion character blueprint and add these four calls to `Enable Master Pose`.

<figure><img src="/files/crgBgWmhPjOksyCuq2rJ" alt=""><figcaption></figcaption></figure>

Then remove everything else so only these five nodes come right after

<figure><img src="/files/AOYzkZXJ4tqYFXIvewoR" alt=""><figcaption></figcaption></figure>

#### Create Retarget Animation Blueprint

In order for the Metahuman to work with the animations that ship with Motion, a new animation blueprint has to be created.

Head over to the body mesh of your metahuman (e.g. f\_med\_nrw\_body) by clicking on the `Body` component and then clicking the folder-icon to navigate to the mesh.

Right-click the mesh and select `Anim Blueprint`.

<figure><img src="/files/oHaM0B5kCiGjU6yCezJB" alt=""><figcaption></figcaption></figure>

Right-click in the AnimGraph, then search for and create a Retarget Pose from Mesh node. Connect this node to the Output Pose node, as shown below.

![](/files/iRhG4Viy6ta14LaFxQt3)

Click the Retarget Pose from Mesh node to select it. Then, in the Details panel, in the Retargeter Asset dropdown, select the `RTG_Mannequin_Motion` Retarget Asset.

Finally, in the Motion character blueprint, select `Body` and give assign it the animation blueprint you just created.

<figure><img src="/files/a4IHD8X4Xz56Oc3WJaXE" alt=""><figcaption></figcaption></figure>

### Fitting Motion to your Metahuman

Depending on the size and volume of your Metahuman, the default configuration for Motion may lead to unintended and / or undesirable results.

We recommend the following steps:

1. Adjust the Capsule Half Height and Capsule Radius to match the shape of the Capsule Component to your Metahuman.
2. Enable `Owner No See` and `Hidden Shadow` for the following components:

* Face
* Fuzz
* Eyelashes
* Beard
* Mustache
* Hair
* Eyebrows

### Finished!

If everything was set up correctly, launching a session should result in your Metahuman being used as the character with all animations and features applied!

For additional information, please check out the [official documentation](https://docs.metahuman.unrealengine.com/en-US/retargeting-animations-to-a-metahuman-at-runtime/) for retargeting by Epic Games.


# Breathing Shake

This page describes how you can adjust the camera shake while you stand still, imitating breathing.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_BreathingShake`. This will open the curve editor.

<figure><img src="/files/SRXt10XaYgo6Dq5Ihs40" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the **Roll** added to the camera.

The `Green` line, Y, translated to the **Pitch** added to the camera.

<figure><img src="/files/UBgS2OQepgEs1YnPlzlF" alt=""><figcaption></figcaption></figure>

The default breathing cycle takes 6 seconds. 3 seconds moving up, 3 seconds moving down.

You can adjust the length by moving both points to the left or right, depending on if you want it to be shorter or longer.

Alternatively, you can hold `CTRL` and click both points and then change the time value at the top of the editor.

![](/files/M6vnuUQoSJjclah6Q0UP)

Adjusting the value of the `Green` line will change how high the character look up while breathing.

Adjusting the value of the `Red` line will change how much to the right the character will look while breathing.

<mark style="color:blue;">You can add additional points to the curve to create a different breathing pattern.</mark>


# Crouch Deceleration

This page describes how you can adjust the deceleration of the player when they start crouching.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_CrouchDeceleration`. This will open the curve editor.

<figure><img src="/files/zAgtsDgpnMIYg8XuNDva" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the progress of deceleration in percent.

With the provided curve this means that the player will reach the full speed penalty of crouching in 1 second.

Valid values for this curve are between 0 (0%) and 1 (100%). Please consider this when editing this curve.

<mark style="color:blue;">You can add additional points to the curve to create a different deceleration pattern.</mark>


# Jump Camera Bounce

<mark style="color:blue;">If you want to edit the camera shake for landing, please head over to the Jump Component page.</mark>

This page describes how you can adjust the camera movement when the player is jumping until right before they land.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_JumpCameraBounce`. This will open the curve editor.

<figure><img src="/files/8DcE6wURaVrHfjE8rm7X" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the **Roll** added to the camera.

The `Green` line, Y, translated to the **Pitch** added to the camera.

The `Blue` line, Z, translates to the **Yaw** added to the camera.


# Sneak Deceleration

This page describes how you can adjust the deceleration of the player when they start sneaking.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_SneakDeceleration`. This will open the curve editor.

<figure><img src="/files/Sz5vX7N4eChSjKccD1Uk" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the progress of deceleration in percent.

With the provided curve this means that the player will reach the full speed penalty of sneaking in 0.7 seconds.

Valid values for this curve are between 0 (0%) and 1 (100%). Please consider this when editing this curve.

<mark style="color:blue;">You can add additional points to the curve to create a different deceleration pattern.</mark>


# Sneak Shake

This page describes how you can adjust the camera movement when the player is sneaking.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_SneakShake`. This will open the curve editor.

<figure><img src="/files/fqrvu3qLWPcHB4O507tg" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the **Roll** added to the camera.

The `Green` line, Y, translated to the **Pitch** added to the camera.

The `Blue` line, Z, translates to the **Yaw** added to the camera.

<figure><img src="/files/aGUMiARYepqvFjUW41zr" alt=""><figcaption></figcaption></figure>

The camera movement takes 1.4 seconds per cycle.


# Sprint Acceleration

This page describes how you can adjust the acceleration of the player when they start sprinting.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_SprintAcceleration`. This will open the curve editor.

<figure><img src="/files/2PNjXe2Xc9SOHWtAEkUf" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the progress of deceleration in percent.

With the provided curve this means that the player will reach the full speed gain of sprinting in 1.4 seconds.

Valid values for this curve are between 0 (0%) and 1 (100%). Please consider this when editing this curve.

<mark style="color:blue;">You can add additional points to the curve to create a different deceleration pattern.</mark>


# Sprint Shake

This page describes how you can adjust the camera movement when the player is sprinting.

To edit the curve, double-click the curve in `Motion\Blueprints\Curves\Curve_SprintShake`. This will open the curve editor.

<figure><img src="/files/XaVMqo8MmELd1jSpHXJ0" alt=""><figcaption></figcaption></figure>

The `Red` line, X, translates to the **Roll** added to the camera.

The `Green` line, Y, translated to the **Pitch** added to the camera.

The `Blue` line, Z, translates to the **Yaw** added to the camera.

<figure><img src="/files/MVEoMuEN3gUYPTY45oCd" alt=""><figcaption></figcaption></figure>

The provided curve will move the camera as shown below. For your convenience, we have recorded this in slow-motion:

The camera movement takes 0.7 seconds per cycle.


# Movement Sounds

### Movement Sound Table

This page describes the structure of the Movement Sound Table which allows you to add your own footsteps for walking, sprinting and crouching, jump sounds, and landing sounds to Motion.

### The DataTable Editor

To open the `DataTable Editor` double-click the provided table which you can find at `Motion\Blueprints\DT_MovementSounds`.

<figure><img src="/files/mFUPaP9bQLCucSuUWPQF" alt=""><figcaption></figcaption></figure>

This table provides all metadata used by Motion to provide you with sounds for your movement needs.

<mark style="color:blue;">To learn more about what each field means, please visit the FStructMovementSound page.</mark>

#### Adding data

To add a new field to the data table, press the `Add` button in the toolbar.

![](/files/qyn1jahAb31K4BTDRYiX)

You can then edit your new row in the `Row Editor` below the table.


# BP\_BaseCurveManager

This page describes the BaseCurveManager Component that ships with Motion. The Base Curve Manager contains the core logic required by all managers.

It handles curve registrations, transition registrations, maintains their status and progress and calls the "Array Updated" function of its child classes.

### Methods

#### Curve Functions

| Name                 | Description                                                                             |
| -------------------- | --------------------------------------------------------------------------------------- |
| AddCurve             | Adds a new curve to the curve array.                                                    |
| DeleteCurve          | Removes a specified curve. Returns false if the specified curve could not be found.     |
| GetCurveByComponent  | Tries to find a curve by its identifier. Returns its index if found, returns -1 if not. |
| GetCurveByIdentifier | Tries to find a curve by its identifier. Returns its index if found, returns -1 if not. |
| SetCurveTickRate     | Sets a Motion Curve's tickrate to the specified value.                                  |
| UnpauseCurve         | Unpauses a specified curve. Returns false if the specified curve could not be found.    |

#### Transitions

| Name                      | Description                                                                                                        |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| DeleteTransition          | Removes a transition from the array.                                                                               |
| GetTransitionByIdentifier | Tries to find a transition given its configuration. Returns its index if found, returns -1 if not.                 |
| GetTransitionsByComponent | Returns all transitions that are associated with the provided component. Returns an empty array if none are found. |
| PauseTransition           | Sets the pause state for all transitions of a given Curved Component.                                              |
| SetInTransitionState      | Updates the transition flag for a transition.                                                                      |
| SetTransitionPauseState   | Sets the pause state for a given curve transition.                                                                 |
| StartTransition           | Adds a new transition to the array and updates the source curve's transition state.                                |
| UpdateTransition          | Updates the active transition seconds of a transition and determines position.                                     |
| UpdateTransitionArray     | Loops through all Motion Curve Transitions, updates their progression & triggers transition updates as required.   |

#### Core

| Name                 | Description                                                          |
| -------------------- | -------------------------------------------------------------------- |
| HandleEventBeginPlay | Called when "Event Begin Play" gets called. Sets up core references. |
| HandleEventTick      | Called every tick. Handles core logic.                               |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

#### Curves

| Name             | Description                                                                        |
| ---------------- | ---------------------------------------------------------------------------------- |
| UpdateCurveArray | Loops through all registered Motion Curves, updates them & triggers update events. |
| ValidateCurve    | Checks if the provided component and curve vector are valid objects.               |

***

### Variables

#### Configuration

| Name                  | Description                                                                             |
| --------------------- | --------------------------------------------------------------------------------------- |
| bShowDebugInformation | If true, various useful variables will be printed on the screen to help with debugging. |
| bIsEnabled            | If false, the manager will only print debug data and not update any curves.             |

#### Manager Data

| Name                         | Description                                  |
| ---------------------------- | -------------------------------------------- |
| ActiveMotionCurveTransitions | Array containing all registered transitions. |
| ActiveMotionCurves           | Array containing all registered curves.      |


# BP\_BaseCharacterCurvedComponent

This page describes the BaseCharacterCurved Component that ships with Motion. The Base Character Curved Component is the direct parent class of all character components, e.g. Sprinting. It provides a BP\_CharacterCoreComponent and BP\_CharacterCurveManager and contains a default implementation for resolving transitions.

### Methods

#### Core

| Name                              | Description                                                                                   |
| --------------------------------- | --------------------------------------------------------------------------------------------- |
| HandleOnEventBeginPlay\_Parent    | Called when "Event Begin Play" gets called. Gets a reference to the Camera Curve Manager.     |
| HandleOnTransitionMaximum\_Parent | Called when "On Transition Maximum" gets called. Deletes the transition and transition curve. |

***

### Variables

#### Default

| Name                  | Description                               |
| --------------------- | ----------------------------------------- |
| CharacterCurveManager | Reference to the Character Curve Manager. |


# BP\_BaseMotionManager

This page describes the BaseMotionManager Component that ships with Motion. The Base Motion Manager currently serves no purpose and is reserved for future use.


# BP\_BreathingComponent

This page describes the Breathing Component that ships with Motion. The Breathing Component provides camera movement for when the player stands still, moving it up and to the side, for a more immersive and dynamic experience.

### Methods

#### Event Handler

| Name                      | Description                                                                                |
| ------------------------- | ------------------------------------------------------------------------------------------ |
| HandleOnEventBeginPlay    | Called when "Event Begin Play" gets called. Sets up events & creates curve.                |
| HandleOnTransitionMaximum | Called when a transition reaches it's peak. Used to update the offset curve configuration. |
| HandleOnVelocityBegin     | Called when the player moves.                                                              |
| HandleOnVelocityStop      | Called when the player stops moving..                                                      |

***

### Variables

#### Configuration

| Name                  | Description                                                                                                        |
| --------------------- | ------------------------------------------------------------------------------------------------------------------ |
| CameraOffsetCurve     | The curve used to move the camera when breathing.                                                                  |
| bShowDebugInformation | If true, various useful variables will be printed on the screen to help with debugging.                            |
| bIsEnabled            | If false, the component stops sending commands to the curve manager and only prints debug information, if enabled. |

#### Constants

| Name      | Description                                                 |
| --------- | ----------------------------------------------------------- |
| CurveType | Type description of the curves generated by this component. |


# BP\_CharacterCoreComponent

This page describes the CharacterCore Component that ships with Motion. The Character Core component provides commonly-used functions for all Curved Motion components and manages camera offsets and player speeds for the Motion Character.

We use this central approach for camera and speed changes to allow multiple sources of changes, where each component only has to manage their own adjustments, avoiding complex logic and computations.

### Dependencies

* Requires the owning Blueprint to be BP\_MotionCharacter.
* Said character must own: A camera, a character movement component, a capsule & a scene component acting as center actor for the dynamic resizing functionality.

### Methods

#### Camera Location Offset

| Name                                | Description                                                                                                                                                                  |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddCameraLocationOffset             | Adds a location of type Vector to the CameraVectors dictionary                                                                                                               |
| AddHeadMovementCameraLocationOffset | Get the player's control rotation and add it to the location offset dictionary to prevent camera clipping into the mesh.                                                     |
| CalculateCameraLocation             | Combines the vectors from the CameraVectors dictionary to a combined camera location offset. If a priority component is selected, it will instead use that component's value |
| FlushCameraLocationOffsets          | Deletes all vectors from the currently dictionary.                                                                                                                           |

#### Camera

| Name                         | Description                                                                                                                                           |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddCameraOffset              | Adds a rotator for a provided component to the dictionary.                                                                                            |
| CalculateCameraOffset        | Gets all values from the Camera Offsets Dictionary and combines them to a single Rotator.                                                             |
| FindCameraOffsetByIdentifier | Tries to find a camera offset by its curve identifier and returns it. Returns -1 if none was found.                                                   |
| FlushCameraOffsets           | Deletes all rotators from the currently dictionary.                                                                                                   |
| RemoveCameraOffset           | Tries to find the provided component and removes it registered offset from the dictionary. If the component is the override one, delete the override. |

#### Walk Speed

| Name               | Description                                                                                                                                                 |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddWalkSpeed       | Adds a speed of type float to the WalkSpeed dictionary                                                                                                      |
| CalculateWalkSpeed | Combines the speeds from the WalkSpeeds dictionary to combined walk speed. If a priority component is selected, it will instead use that component's value. |
| FlushWalkSpeeds    | Deletes all rotators from the currently dictionary.                                                                                                         |

#### Components

| Name              | Description                                                                             |
| ----------------- | --------------------------------------------------------------------------------------- |
| GetCoreComponents | Get required components Character, Movement, Camera & Capsule and save their references |

#### Core

| Name              | Description                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------- |
| GetGroundInfo     | Finds the current floor and saves information about it                                          |
| HandleOnEventTick | Core logic handler. Calculates camera offset and player speed from data provided by components. |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

***

### Variables

#### Configuration

| Name                  | Description                                                                                  |
| --------------------- | -------------------------------------------------------------------------------------------- |
| GroundTraceDistance   | Distance in units used, in addition to the capsule half height, to locate the nearest floor. |
| bShowDebugInformation | If enabled, will print useful information on the players screen.                             |

#### Component Data

| Name                                     | Description                                                                                                               |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| InitialCameraLocation                    | Location of the camera when first spawning the player. Used to add the Global Camera Location Offset.                     |
| CachedGroundInfo                         | Information about the last traced floor. Used for animation purposes.                                                     |
| CalculatedCameraLocationOffset           | The current calculated camera location offset of the player in the current frame.                                         |
| PriorityComponentForCameraOffsetOverride | If set, refers to which components speed value will be used. If this is set, all other values will be ignored.            |
| PriorityComponentForCameraOverride       | If set, refers to which curves rotation value will be used. If this is set, all other values will be ignored.             |
| PriorityComponentForSpeedOverride        | If set, refers to which components speed value will be used. If this is set, all other values will be ignored.            |
| CameraVectors                            | Dictionary holding information about what components wants to add what location to the combined camera location.          |
| WalkSpeeds                               | Dictionary holding information about what components wants to add what speed to the combined Max Walk Speed.              |
| CameraOffsets                            | Dictionary holding information about what component wants to add what rotation to the combined offset.                    |
| GlobalCameraLocationOffset               | The combined result of all registered camera location offsets. This vector will be set as the camera\\'s position offset. |
| GlobalCameraOffset                       | The combined result of all registered camera offsets. This rotator will be set as the cameras local offset.               |

#### Default

| Name        | Description                    |
| ----------- | ------------------------------ |
| CenterActor | Reference to the Center Actor. |

#### Components

| Name              | Description                                    |
| ----------------- | ---------------------------------------------- |
| Capsule           | Reference to the Character Capsule Collision.  |
| CharacterMovement | Reference to the Character Movement Component. |
| Camera            | Reference to the Character Blueprint Camera.   |
| Character         | Reference to the Character blueprint.          |


# BP\_CharacterCurveManager

This page describes the CharacterCurveManager Component that ships with Motion. The CharacterCurveManager Component provides TBD.

### Dependencies

* requires BP\_CharacterCoreComponent.

### Methods

#### Core

| Name                   | Description                                                                                                      |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| HandleOnEventBeginPlay | Called when "Event Begin Play" gets called. Gets a reference to the Example Gameplay Manager from the Game Mode. |

#### Curve Functions

| Name                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| UpdateCameraCurveArray | Updates the Camera Curve Array with the Motion Curve Array's base data.                                             |
| UpdateCameraCurveData  | Loops through Camera Curves array and updates their tickrate (if transitioning) or rotation (if not transitioning). |

#### Transitions

| Name                        | Description                                                              |
| --------------------------- | ------------------------------------------------------------------------ |
| UpdateCameraTransitionArray | Updates the Camera Transition Array from data of the base curve manager. |
| UpdateCameraTransitionData  | Updates the Camera Transition Array from data of the base curve manager. |

***

### Variables

#### Configuration

| Name                      | Description                                                                              |
| ------------------------- | ---------------------------------------------------------------------------------------- |
| bShowThisDebugInformation | If ticked, various useful variables will be printed on the screen to help with debugging |

#### Components

| Name                   | Description                                |
| ---------------------- | ------------------------------------------ |
| CharacterCoreComponent | Reference to the character core component. |

#### Constants

| Name      | Description                                             |
| --------- | ------------------------------------------------------- |
| CurveType | Type description of the curves handled by this manager. |

#### Manager Data

| Name                    | Description                             |
| ----------------------- | --------------------------------------- |
| ActiveCameraTransitions | Array of registered camera transitions. |
| ActiveCameraCurves      | Array of registered camera curves.      |


# BP\_CoreComponent

This page describes the Core Component that ships with Motion. The Core Component provides core functions used by a variety of components. Mostly covering Exception Handling.

### Methods

#### Debug

| Name                                          | Description                                                                                  |
| --------------------------------------------- | -------------------------------------------------------------------------------------------- |
| HandleMissingComponentDependencyException     | Quits the game and prints an error message that a required component could not be found.     |
| HandleMissingConfigurationDependencyException | Quits the game and prints an error message that a required configuration could not be found. |
| HandleMissingDataException                    | Quits the game and prints an error message that a required member is NULL.                   |

***

### Variables


# BP\_CrouchingComponent

This page describes the Crouching Component that ships with Motion. The Crouching Component provides smooth crouching and uncrouching for characters.

It also provides floor & ceiling detection to prevent the capsule from expanding too much when uncrouching, but still allowing for partial uncrouching if the ceiling height allows it. A speed penalty is applied when being fully crouched.

### Dependencies

* requires BP\_JumpingComponent.

### Methods

#### Crouch Handlers

| Name              | Description                                      |
| ----------------- | ------------------------------------------------ |
| DoCrouch          | Logic for Crouching. See comments for details.   |
| DoUncrouch        | Logic for Uncrouching. See comments for details. |
| HandleCrouchInput | Handles input set by player input                |
| SetCrouch         | Updates crouch states. Used by input events.     |

#### Getters

| Name                         | Description                                                                 |
| ---------------------------- | --------------------------------------------------------------------------- |
| GetCapsuleOverlapCheckResult | Checks if the player would be still enroached if we'd adjust their position |
| GetCharacterVelocity         | Returns the player speed in units per second.                               |

#### Event Handler

| Name                        | Description                                                                                                                                       |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| HandleOnCrouchCrouched      | Called whenever the crouch position updates. Calls event for other components that listen to crouch changes. Useful for implementing sliding.     |
| HandleOnCrouchPressed       | Upon crouch key-press, mark the character as wanting to crouch                                                                                    |
| HandleOnCrouchReleased      | When releasing the crouch button, update crouch intention state                                                                                   |
| HandleOnCrouchUncrouched    | Called whenever the uncrouch position updates. Calls event for other components that listen to uncrouch changes. Useful for implementing sliding. |
| HandleOnEventBeginPlay      | Called when "Event Begin Play" gets called. Sets up events and saves base values.                                                                 |
| HandleOnEventTick           | Core logic handlers. Handles Crouch Inputs and prints Debug information                                                                           |
| HandleOnMovementModeChanged | Handles all Movement related changes                                                                                                              |

#### Event Dispatchers

| Name                    | Description                                                              |
| ----------------------- | ------------------------------------------------------------------------ |
| OnCrouchUpdate          | Triggered when the capsule size changes due to crouching or uncrouching. |
| OnCrouchFullyCrouched   | Triggered when the player is fully crouched.                             |
| OnCrouchFullyUncrouched | Triggered when the player is fully uncrouched.                           |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

#### Manipulators

| Name              | Description                        |
| ----------------- | ---------------------------------- |
| ResetMaxWalkSpeed | Removes the crouch speed modifiers |

***

### Variables

#### Configuration

| Name                         | Description                                                                                                                            |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| TargetCrouchCameraOffset     | Camera Offset to add when the player is crouching.                                                                                     |
| ClassExceptionListForOverlap | Array of Actor classes that are being ignored in ceiling checks.                                                                       |
| bIsInputToggle               | If true, the input key is used as toggle. This is especially useful for use on gamepads where it is more tiring to hold down a button. |
| bShowDebugInformation        | If true, various useful variables will be printed on the screen to help with debugging.                                                |
| bIsEnabled                   | If false, the component will only print debug data and not update any other values.                                                    |

#### Component Data

| Name              | Description                                                         |
| ----------------- | ------------------------------------------------------------------- |
| OverlapActorTypes | Actor Types that are used for collision detection when uncrouching. |

#### Event Dispatcher

| Name                    | Description                                                              |
| ----------------------- | ------------------------------------------------------------------------ |
| OnCrouchFullyUncrouched | Triggered when the player is fully uncrouched.                           |
| OnCrouchFullyCrouched   | Triggered when the player is fully crouched.                             |
| OnCrouchUpdate          | Triggered when the capsule size changes due to crouching or uncrouching. |

#### States

| Name                         | Description                                                                                                     |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------- |
| bCrouchMaintainsBaseLocation | If true, crouching should keep the base of the capsule in place by lowering the center of the shrunken capsule. |
| bIsCrouched                  | If true, the player is fully crouched.                                                                          |
| bIsInCrouch                  | If true, the player is currently transitioning in a crouch.                                                     |
| bWantsToCrouch               | If true, the player signalised, usually by pressing the crouch button, that they want to crouch.                |

#### Default

| Name             | Description                         |
| ---------------- | ----------------------------------- |
| JumpingComponent | Reference to the jumping component. |


# BP\_CurvedComponent

This page describes the Curved Component that ships with Motion. The Curved Component provides all curve events that are used by child classes.


# BP\_IdleComponent

This page describes the Idle Component that ships with Motion. The Idle Component provides the option to play camera animations when the player has been idle for a configurable amount of time.

### Methods

#### Event Handler

| Name                   | Description                                                            |
| ---------------------- | ---------------------------------------------------------------------- |
| HandleOnCameraInput    | Called when the player moves.                                          |
| HandleOnCurveMaximum   | Called when the component's active curve reaches its peak.             |
| HandleOnEventBeginPlay | Called when "Event Begin Play" gets called. Sets up events.            |
| HandleOnEventTick      | Core logic handler. Updates the timer & checks if idle should kick in. |
| HandleOnMovementInput  | Called when the player stops moving..                                  |
| HandleOnPlayerJump     | Called when the player jumped.                                         |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

#### Manipulators

| Name                | Description                                                                      |
| ------------------- | -------------------------------------------------------------------------------- |
| ResetIdleSeconds    | Resets the idle timer.                                                           |
| SetIdleCurve        | Selects a random curve from the configured list of curves.                       |
| StopIdleAnimation   | Removes the camera offset and resets states.                                     |
| UpdateDeltaSeconds  | Updates the idle timer.                                                          |
| ValidateIdleSeconds | Checks if the player was idle long enough and prevents multiple set curve calls. |

***

### Variables

#### Configuration

| Name                  | Description                                                                                                                           |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| IdleCurves            | A list of curves used for when the player goes idle. The component selects a random curve when the player goes idle out of this list. |
| bShowDebugInformation | If true, various useful variables will be printed on the screen to help with debugging.                                               |
| bIsEnabled            | If false, the component will only print debug data and not update any other values.                                                   |

#### Constants

| Name      | Description                                               |
| --------- | --------------------------------------------------------- |
| CurveType | Type Identifier for the curves created by this component. |

#### Component Data

| Name                    | Description                                                            |
| ----------------------- | ---------------------------------------------------------------------- |
| bHasIdleAnimationPlayed | If true, an idle animation has been played since the player went idle. |
| bIsIdle                 | If true, no input has been registered for longer than SecondsToIdle.   |
| ActiveCurve             | The currently active curve used for the idle animation.                |


# BP\_JumpingComponent

This page describes the Jumping Component that ships with Motion. The Jumping Component provides a custom jumping component and replaces the default Jump functionality. It features a camera bounce when jumping & landing and a stamina system providing dynamic jump force.

### Methods

#### Manipulators

| Name                       | Description                                                                                                     |
| -------------------------- | --------------------------------------------------------------------------------------------------------------- |
| AbortBounce                | Resets bounce state and saves the current target rotation                                                       |
| HandleImpactBounce         | Sets the bounce target and enables bounce state.                                                                |
| MoveCameraToTargetRotation | Adds the target offset to the core component                                                                    |
| ResetStamina               | Resets stamina values.                                                                                          |
| SetPlayerJumpEnabled       | Sets the ability to jump in the characters movement component.                                                  |
| UpdateDeltaSeconds         | Updates progress on either the jumping camera curve or the bounce camera curve, depending on the player's state |
| UpdateFallingVelocity      | Updates last known falling velocity if we fall. Used to prevent camera bounce from little drops.                |
| UpdateStamina              | Updates Stamina and determines if the player is capable of jumping (has enough stamina)                         |
| UpdateTargetRotation       | Handles Rotation updates given the current player state                                                         |
| ValidateRotationTarget     | Checks if we are close to the end of the bounce and stops it if so.                                             |

#### Event Handler

| Name                        | Description                                                                                            |
| --------------------------- | ------------------------------------------------------------------------------------------------------ |
| HandleOnEventBeginPlay      | Called when "Event Begin Play" gets called. Sets up events and saves base values.                      |
| HandleOnEventTick           | Core logic handlers. Handles rotation and stamina updates.                                             |
| HandleOnJumpJumped          | Called when after a jump was executed. Useful for post-jump logic.                                     |
| HandleOnJumpPressed         | Called when the player presses the Jump key. Adjusts the JumpZ Velocity based on the available stamina |
| HandleOnJumpReleased        | Called when the player releases the jump key. Currently unused.                                        |
| HandleOnJumpStopped         | Called after \\"Jump Stopped\\" has executed. Currenly unused.                                         |
| HandleOnMovementModeChanged | Called when the movement mode changes (e.g. from falling to walking)                                   |
| HandleOnPlayerLanded        | Called when the player has landed on the floor. Resets stamina and jump states.                        |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

***

### Variables

#### Configuration

| Name                  | Description                                                                            |
| --------------------- | -------------------------------------------------------------------------------------- |
| CameraBounceCurve     | The curve used for the jumping bounce.                                                 |
| bShowDebugInformation | If true, various useful variables will be printed on the screen to help with debugging |
| bIsEnabled            | If false, the component will only print debug data and not update any other values.    |

#### Constants

| Name      | Description                                               |
| --------- | --------------------------------------------------------- |
| CurveType | Type Identifier for the curves created by this component. |

#### States

| Name              | Description                                                                                                      |
| ----------------- | ---------------------------------------------------------------------------------------------------------------- |
| bIsFalling        | If true, the current movement mode of the player is Falling.                                                     |
| bIsRecovering     | If true, the players jump stamina is currently recovering.                                                       |
| bIsBounceReversed | If true, the characters camera is currenly bouncing back up from a previous bounce down from landing on a floor. |
| bIsBouncing       | If true, the characters camera is currently bouncing down from landing on a floor.                               |
| bIsJumping        | If true, the player is currently jumping.                                                                        |
| bWantsToJump      | If true, the player has signalized that they want to jump (usually by pressing the jump key)                     |

#### Component Data

| Name                  | Description                                                                                                                                                 |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BounceTargetRotation  | The current target rotation for the camera bounce for when the player lands on a floor.                                                                     |
| CurrentTargetRotation | The current rotation the component rotates towards to.                                                                                                      |
| StaminaStartRotation  | Saved rotation from when the player starts jumping while low on stamina. Used to for smoother camera movement between bounce, sprint and low-stamina jumps. |


# BP\_MotionCharacter

This page describes the Motion Character Component that ships with Motion. The Motion Character provides a pre-configured character blueprint for your convenience. It includes all components that ship with motion and is ready-to-play.

It also processes all player input and provides the input events that are consumed by other components.

### Methods

#### Core

| Name                     | Description                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------- |
| AdjustToCapsuleCenter    | Moves the meshes relative to the Capsule Center component. This is needed if the capsule half height changes. |
| GetSquaredPlayerVelocity | Returns the player velocity as squared float to get speed in units per second.                                |
| IsAboveCameraThreshold   | Returns if the camera movement is faster than the Movement Input Threshold.                                   |
| IsAboveMovementThreshold | Returns if the character is faster than the Movement Input Threshold.                                         |

#### Event Handler

| Name              | Description                                                     |
| ----------------- | --------------------------------------------------------------- |
| HandleOnEventTick | Checks if the player is moving and calls the appropriate event. |

***

### Variables

#### Configuration

| Name               | Description                                                                                                   |
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
| CameraMinimumPitch | Used to define how far down the player is allowed to move the camera. Used to prevent clipping into the mesh. |
| UseDebugCamera     | If enabled, makes the primary camera visible and shows a third-person perspective while playing.              |

#### Event Dispatchers

| Name                       | Description                                       |
| -------------------------- | ------------------------------------------------- |
| OnMovementInput            | Triggered when a player input is registered.      |
| OnCameraInput              | Triggered when the camera moves.                  |
| OnCharacterMovementChanged | Triggered when the player moves.                  |
| OnMovementModeChanged      | Triggered when the players movement mode changes. |
| OnPlayerLanded             | Triggered when a player lands on a floor.         |
| OnJumpStopped              | Triggered after a jump was stopped.               |
| OnJumpJumped               | Triggered after a jump was executed.              |
| OnVelocityStop             | Triggered when the player stops moving.           |
| OnVelocityBegin            | Triggered when the player starts moving.          |

#### Component Data

| Name                          | Description                                                           |
| ----------------------------- | --------------------------------------------------------------------- |
| bEventOnVelocityStopTriggered | Is set to true, if the velocity stop event has been triggered already |


# BP\_MotionComponent

This page describes the Motion Component that ships with Motion. The Motion Component currently serves no purpose and is reserved for future use.


# BP\_MovementSoundComponent

This page describes the Movement Sound Component that ships with Motion. The Movement Sound Component handles input events caused by Animation Notifiers by finding and calling the correct MetaSound source.

### Dependencies

* requires BP\_SprintingComponent.
* requires BP\_CrouchingComponent.

### Methods

#### Getters

| Name                        | Description                                                                                                                               |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| GetCurrentFloorSurface      | Returns the current floor's surface type. Returns "Default" is none is set.                                                               |
| GetMetasound                | Finds sounds with the given sound type and surface type from the sound data table. Prints warning messages if a sound could not be found. |
| GetSoundTypeForMovementMode | Returns the proper EMovementSoundType given if the player has jumped or not.                                                              |
| GetSoundTypeForSide         | Returns the proper EMovementSoundType given the step side and sprint state.                                                               |
| GetSoundVolume              | Returns the volume for a sound. If bUseSpeedForVolumeAdjust is true, it will adjust the volume according to the player's speed.           |

#### Event Handler

| Name                        | Description                                                                                                                                                                                                    |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HandleEventOnBeginPlay      | Called when "Event Begin Play" gets called. Sets up events and saves component references.                                                                                                                     |
| HandleFootsteps             | Handles footsteps & footstep timer. Checks if the player should trigger another sound to be played, if they are fast enough to play a sound and the selection of a sound with volume adjustment for crouching. |
| HandleJumpLandSounds        | Handles landing sounds. Detects the floor beneath the player, its surface and then chooses a sound fit for that surface.                                                                                       |
| HandleOnMovementModeChanged | Called when the movement mode changes (e.g. from falling to walking)                                                                                                                                           |

***

### Variables

#### Configuration

| Name                         | Description                                                                                                                                                                            |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bShowDebugInformation        | If true, various useful variables will be printed on the screen to help with debugging                                                                                                 |
| bUseSpeedForVolumeAdjustment | If true, the players speed will be used to reduce the volume of footsteps. Useful if you want steps to be more quiet if the player is only slighty tipping their controllers joystick. |
| bIsEnabled                   | If false, the component will only print debug data and not update any other values.                                                                                                    |

#### Default

| Name               | Description                           |
| ------------------ | ------------------------------------- |
| SprintingComponent | Reference to the sprinting component. |
| CrouchingComponent | Reference to the crouching component. |

#### Component Data

| Name         | Description                        |
| ------------ | ---------------------------------- |
| CurrentSound | The current movement sound played. |


# BP\_SneakingComponent

This page describes the Sneaking Component that ships with Motion. The Sneaking Component provides an alternative movement mode for players. When holding (or pressing) the Sneak Key, the player decelerates towards a sneak speed penaltythat can be configured in this component.

Footsteps also get disabled while sneaking. A deceleration of the player does not get applied if the player starts sneaking when standing still.

Unlike the Sprinting Component, no camera shake is applied.

### Dependencies

* requires BP\_SprintingComponent.

### Methods

#### Event Handler

| Name                   | Description                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| HandleOnEventBeginPlay | Called when "Event Begin Play" gets called. Sets up events and saves component references. |
| HandleOnEventTick      | Core logic handlers. Handles Sneak Inputs, Updates timers and prints Debug information     |
| HandleOnSneakPressed   | Called when the player presses the sneak key. Resets timers and sets sneak state.          |
| HandleOnSneakReleased  | Called when the player releases the sneak key. Resets sneaking and its state.              |

#### Getters

| Name             | Description                                                                                                                         |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| IsAllowedToSneak | Returns true if the player is allowed to sneak. Returns false if the player is falling, not holding the sprint key or is sprinting. |

#### Manipulators

| Name                     | Description                                                                               |
| ------------------------ | ----------------------------------------------------------------------------------------- |
| LerpTowardsSneakingSpeed | Lerps towards sneak speed and updates the speed for this component in the core component. |
| ResetSneaking            | Removes speed penalty from sneaking.                                                      |
| UpdateDeltaSeconds       | Update the progress on the sneak timer.                                                   |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

***

### Variables

#### Configuration

| Name                   | Description                                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| SneakDecelerationCurve | The curve float used to decelerate the player towards the sneaking speed penalty.                                                      |
| bIsInputToggle         | If true, the input key is used as toggle. This is especially useful for use on gamepads where it is more tiring to hold down a button. |
| bShowDebugInformation  | If true, various useful variables will be printed on the screen to help with debugging                                                 |
| bIsEnabled             | If false, the component will only print debug data and not update any other values.                                                    |

#### Default

| Name            | Description                       |
| --------------- | --------------------------------- |
| SprintComponent | Reference to the sprint component |

#### Component Data

| Name                  | Description                                             |
| --------------------- | ------------------------------------------------------- |
| CurrentTargetRotation | The current requested camera offset for this compoenent |

#### States

| Name               | Description                                                  |
| ------------------ | ------------------------------------------------------------ |
| bIsSneaking        | If true, the player is currently sneaking.                   |
| bIsHoldingSneakKey | If true, the player is currently holding down the sneak key. |


# BP\_SprintingComponent

This page describes the Sprinting Component that ships with Motion. The Sprinting Component provides an alternative movement mode for players. When holding (or pressing) the Sprint Key, the player accelerates towards a sprint bonus speed that can be configured in this component.

The component also detects if the player is moving backwards or sideways, either aborting the sprint or applying a speed penalty for moving sideways.

While the player sprints, a camera shake is applied.

### Dependencies

* requires BP\_WalkingComponent.
* requires BP\_CrouchingComponent.

### Methods

#### Manipulators

| Name                       | Description                                                                                                  |
| -------------------------- | ------------------------------------------------------------------------------------------------------------ |
| CalculateCurrentPenalty    | Gets the current penalty and applies it, unless the newly calculated penalty is near to zero                 |
| LerpTowardsSprintingSpeed  | Applies the current speed bonus                                                                              |
| ResetPenalty               | Resets penalty related variables                                                                             |
| ResetSprint                | Resets sprint state and speed                                                                                |
| UpdateDeltaSeconds         | Updates progress on sprint shake camera curve, timer for holding the key down & penalty timer if penalized   |
| UpdateMovementDirection    | Determines which direction the player is moving towards to by parsing their normalized direction             |
| UpdateTargetCameraRotation | Gets the current position of the camera shake curve and updates the target rotation                          |
| ValidateActiveDeltaSeconds | Checks if the sprint shake curve progress is at its peak and resets it then to ensure looped camera movement |
| ValidateMovement           | Updates status of player being able to sprint and applies / resets penalty according to movement changes     |

#### Event Handler

| Name                   | Description                                                                               |
| ---------------------- | ----------------------------------------------------------------------------------------- |
| HandleOnEventBeginPlay | Called when "Event Begin Play" gets called. Sets up events and gets component references. |
| HandleOnEventTick      | Core logic handling. See detailed comments.                                               |
| HandleOnSprintPressed  | When pressing the sprint key, reset timers & toggle sprint key state                      |
| HandleOnSprintReleased | When releasing the sprint key, reset sprint timers, state & values                        |
| HandleOnVelocityStop   | Called when player stops moving. Resets sprinting.                                        |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

***

### Variables

#### Configuration

| Name                                    | Description                                                                                                                            |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| SprintCameraLocationOffsetAnimationTime | The amount of time it should take to animate towards the SprintCameraLocationOffset                                                    |
| SprintCameraLocationOffset              | The offset that should be lerped towards to when the user starts sprinting.                                                            |
| SprintAccelerationCurve                 | The curve float used to accelerate the player into sprinting to SprintSpeed                                                            |
| SprintShakeCurve                        | The curve vector used to move the camera when sprinting                                                                                |
| bIsInputToggle                          | If true, the input key is used as toggle. This is especially useful for use on gamepads where it is more tiring to hold down a button. |
| bShowDebugInformation                   | If ticked, various useful variables will be printed on the screen to help with debugging                                               |
| bIsEnabled                              | If unticked, the component will only print debug data and not update any other values.                                                 |

#### Constants

| Name      | Description                                               |
| --------- | --------------------------------------------------------- |
| CurveType | Type Identifier for the curves created by this component. |

#### Default

| Name             | Description                       |
| ---------------- | --------------------------------- |
| WalkingComponent | Reference to the crouch component |
| CrouchComponent  | Reference to the crouch component |

#### States

| Name                | Description                                                                       |
| ------------------- | --------------------------------------------------------------------------------- |
| bHasBeenPenalized   | If true, the player has already been penalized for a penalized movement action.   |
| bIsPenalized        | If true, the sprint speed is currently penalized (e.g. due to penalized movement) |
| bCanSprint          | If true, all conditions are met that would allow the player to start sprinting    |
| bIsSprinting        | If true, the player is sprinting                                                  |
| bIsHoldingSprintKey | If true, the player is holding down the sprint key                                |

#### Component Data

| Name                     | Description                                             |
| ------------------------ | ------------------------------------------------------- |
| CurrentEnumCurveResult   | The current position of the curve                       |
| CurrentMovementDirection | The current direction the player is moving towards to   |
| CurrentTargetRotation    | The current requested camera offset for this compoenent |


# BP\_TrueFirstPersonComponent

This page describes the TrueFirstPerson Component that ships with Motion. The True First Person component contains no logic. It purly serves as identifier.


# BP\_WalkingComponent

This page describes the Walking Component that ships with Motion. The Walking Component provides camera movement for basic player movement and configurable walking acceleration.

### Dependencies

* requires BP\_JumpingComponent.
* requires BP\_SprintingComponent.
* requires BP\_CrouchingComponent.

### Methods

#### Event Handler

| Name                   | Description                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| HandleOnCurveMaximum   | Called when the component's active curve reaches its peak.                                 |
| HandleOnEventBeginPlay | Called when "Event Begin Play" gets called. Sets up events and saves component references. |
| HandleOnEventTick      | Core logic handling. See detailed comments.                                                |
| HandleOnPlayerLanded   | Called when the player lands.                                                              |
| HandleOnVelocityBegin  | Called when player starts moving.                                                          |
| HandleOnVelocityStop   | Called when player stops moving.                                                           |

#### Manipulators

| Name                         | Description                                                                                                |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------- |
| LerpTorwardsWalkingSpeed     | Applies the current walking speed, relative to curve progression.                                          |
| ResetWalkAccelerationSeconds | Resets walk acceleration, e.g. after stopping to walk                                                      |
| UpdateDeltaSeconds           | Updates progress on sprint shake camera curve, timer for holding the key down & penalty timer if penalized |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

***

### Variables

#### Configuration

| Name                         | Description                                                                                                     |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------- |
| PostLandingAccelerationCurve | The curve vector used to accelerate when landing.                                                               |
| WalkAccelerationCurve        | The curve vector used to accelerate when walking.                                                               |
| WalkShakeCurve               | The curve vector used to move the camera when walking.                                                          |
| bUseLandingAcceleration      | If true, uses LandingAccelerationCurve instead of WalkAccelerationCurve when landing.                           |
| bUseWalkAcceleration         | If true, uses WalkAccelerationCurve to accelerate the player instead of instantly setting the BaseMaxWalkSpeed. |
| bShowDebugInformation        | If ticked, various useful variables will be printed on the screen to help with debugging                        |
| bIsEnabled                   | If unticked, the component will only print debug data and not update any other values.                          |

#### Constants

| Name      | Description                                               |
| --------- | --------------------------------------------------------- |
| CurveType | Type Identifier for the curves created by this component. |

#### Component Data

| Name                    | Description                                             |
| ----------------------- | ------------------------------------------------------- |
| ActiveAccelerationCurve | The currently used acceleration curve.                  |
| CurrentTargetRotation   | The current requested camera offset for this compoenent |

#### States

| Name                   | Description                      |
| ---------------------- | -------------------------------- |
| bHasLandedWithOverride | If true, the player is sprinting |
| bIsWalking             | If true, the player is sprinting |

#### Default

| Name               | Description                       |
| ------------------ | --------------------------------- |
| JumpingComponent   | Reference to the sprint component |
| SprintingComponent | Reference to the sprint component |
| CrouchComponent    | Reference to the crouch component |


# ECurvePositions

This page describes the ECurvePositions enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) is the list of positions in a curve.

### Constants

| Name             | Description                               |
| ---------------- | ----------------------------------------- |
| Undefined        | Undefined. Do not use.                    |
| CurveMin         | Start point of curve.                     |
| CurveMax         | End point of curve.                       |
| CurveProgressing | Any point between start and end of curve. |


# ECurveTimes

This page describes the ECurveTimes enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) describes the Time positions of a curve.

### Constants

| Name         | Description                       |
| ------------ | --------------------------------- |
| CurveMinTime | Start time of a curve. Usually 0. |
| CurveMaxTime | End time of a curve.              |


# EMovementDirections

This page describes the EMovementDirections enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) describes all possible directions a player can move.

### Constants

| Name            | Description                                      |
| --------------- | ------------------------------------------------ |
| Undefined       | Undefined. Do not use.                           |
| Forward         | Walking forward.                                 |
| ForwardSideway  | Walking forward and sideways at the same time.   |
| Backward        | Walking backwards.                               |
| BackwardSideway | Walking backwards and sideways at the same time. |


# EMovementEvents

This page describes the EMovementEvents enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) describes all Movement Events that can trigger movement sounds.

### Constants

| Name   | Description                       |
| ------ | --------------------------------- |
| Jumped | Triggered when the player jumped. |
| Landed | Triggered when the player landed. |


# EMovementSoundTypes

This page describes the EMovementSoundTypes enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) describes all sound types that Motion supports for movement sounds.

### Constants

| Name        | Description                          |
| ----------- | ------------------------------------ |
| StepLeft    | Left foot while walking.             |
| StepRight   | Right foot while walking.            |
| SprintLeft  | Left foot while sprinting.           |
| SprintRight | Right foot while sprinting.          |
| CrouchLeft  | Left foot while crouching.           |
| CrouchRight | Right foot while crouching.          |
| Jump        | When a jump has started.             |
| Landing     | When the player lands on the ground. |


# ETransitionCurves

This page describes the ETransitionCurves enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) describes all types of Transition curves.

### Constants

| Name        | Description                                |
| ----------- | ------------------------------------------ |
| Source      | The curve that is being transitioned from. |
| Destination | The curve that is being transitioned to.   |


# ETransitionPositions

This page describes the ETransitionPositions enum that ships with Motion. The [structure](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html) describes all positions of a transition.

### Constants

| Name          | Description                      |
| ------------- | -------------------------------- |
| Undefined     | Undefined. Do not use.           |
| InTransition  | Any point between start and end. |
| TransitionMin | Start of transition.             |
| TransitionMax | End of transition.               |


# FStructCameraCurve

This page describes the FStructCameraCurve struct that ships with Motion. The enumeration describes TBD.

### Members

| Name            | Description                           |
| --------------- | ------------------------------------- |
| MotionCurve     | Reference to the Motion Curve.        |
| CurrentRotation | Current Rotation of the Camera Curve. |


# FStructCameraCurveTransition

This page describes the FStructCameraCurveTransition struct that ships with Motion. The enumeration describes TBD.

### Members

| Name            | Description                                                                                                             |
| --------------- | ----------------------------------------------------------------------------------------------------------------------- |
| TransitionData  | Reference to the Motion Curve Transition.                                                                               |
| Rotation        | Current Transition Rotation.                                                                                            |
| InitialRotation | Rotation with which the transition has begun. Usually the last frame of the source curve before the transition started. |


# FStructCharacterGroundInfo

This page describes the FStructCharacterGroundInfo struct that ships with Motion. The enumeration describes TBD.

### Members

| Name            | Description                                                            |
| --------------- | ---------------------------------------------------------------------- |
| LastUpdateFrame | Frame count of the last frame this instance of the struct was updated. |
| GroundDistance  | Last cached distance to the ground.                                    |
| GroundHitResult | Hit Result of the last cached floor hit result.                        |


# FStructMotionCurve

This page describes the FStructMotionCurve struct that ships with Motion. The enumeration describes TBD.

### Members

| Name               | Description                                                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------- |
| Identifier         | The Motion Curve Identifier for this Motion Curve.                                             |
| Configuration      | The Motion Curve Configuration for this Motion Curve.                                          |
| bIsReversing       | If true, the Curve is currently reversing.                                                     |
| bIsPaused          | If true, the curve is currently paused.                                                        |
| bIsTransitioning   | If true, the curve is currently transitioning                                                  |
| bIsTransitionCurve | If true, this curve was created as part of a transition and is currently used in a transition. |
| ActiveSeconds      | The amount of seconds this curve has been running.                                             |


# FStructMotionCurveConfiguration

This page describes the FStructMotionCurveConfiguration struct that ships with Motion. The enumeration describes TBD.

### Members

| Name           | Description                                                   |
| -------------- | ------------------------------------------------------------- |
| bShouldLoop    | If true, the curve will loop when it reaches its end.         |
| bShouldReverse | If true, the curve will reverse when reaching its end.        |
| bHasPriority   | If true, this curve and only this curve will be used.         |
| Tickrate       | Tickrate at which the curve is being played at. Default is 1. |


# FStructMotionCurveIdentifier

This page describes the FStructMotionCurveIdentifier struct that ships with Motion. The enumeration describes TBD.

### Members

| Name            | Description                               |
| --------------- | ----------------------------------------- |
| CurvedComponent | The component the Curve is being used in. |
| CurveVector     | The curve vector for this Curve.          |
| CurveType       | Type description of the curve.            |


# FStructMotionCurveTransition

This page describes the FStructMotionCurveTransition struct that ships with Motion. The enumeration describes TBD.

### Members

| Name                    | Description                                                                      |
| ----------------------- | -------------------------------------------------------------------------------- |
| TransitionConfiguration | The Motion Curve Transition Configuration used for this Motion Curve Transition. |
| ActiveTransitionSeconds | Seconds the Transition has been active.                                          |
| bIsPaused               | If true, the transition is currently paused.                                     |


# FStructMotionCurveTransitionConfiguration

This page describes the FStructMotionCurveTransitionConfiguration struct that ships with Motion. The enumeration describes TBD.

### Members

| Name             | Description                                                                            |
| ---------------- | -------------------------------------------------------------------------------------- |
| Identifier       | The source Motion Curve Identifier used in this Motion Curve Transition Configuration. |
| TargetIdentifier | The target Motion Curve Identifier used in this Motion Curve Transition Configuration. |
| TransitionTime   | Time in seconds for how long the transition should last.                               |
| TickRate         | Tickrate at which the curve is being played at.                                        |


# FStructMovementSound

This page describes the FStructMovementSound struct that ships with Motion. The enumeration describes TBD.

### Members

| Name            | Description                                             |
| --------------- | ------------------------------------------------------- |
| Type            | The type of EMovementSoundType this movement sound is.  |
| MetasoundSource | Reference to the Meta Sound Source used for this sound. |
| Surface         | Reference to the physical surface used for this sound.  |


