> For the complete documentation index, see [llms.txt](https://docs.otherside.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherside.xyz/platform-documentation/creation/unreal-development/release-notes/breaking-changes-further-details/breaking-change-details-deprecating-j_charactermovementcomponent-and-jm_animvarscomponent.md).

# Breaking Change Details: Deprecating J\_CharacterMovementComponent and JM\_AnimVarsComponent

{% hint style="info" %}
The following is a significant breaking change in upgrading to release v39. If you are using the simplified base classes (i.e. not the deprecated classes with e.g. the `Origin` or `J_` prefixes), you will be affected, and will need to take action.

If you have extended the deprecated classes, and are using your own anim instance (ABP), you will likely also be affected (see [#modified-abp\_m2\_human](#modified-abp_m2_human "mention")). In that case, you will need to make sure your ABP is correctly reflected in your crowd, explained in the [#if-you-want-to-keep-using-the-deprecated-classes-only-recommended-as-a-temporary-solution](#if-you-want-to-keep-using-the-deprecated-classes-only-recommended-as-a-temporary-solution "mention") section
{% endhint %}

## Does this affect me?

Have a look through the [#whats-changed-and-why](#whats-changed-and-why "mention") section. Some sections may not be relevant to your project; if so, feel free to skip them.

If your character extends e.g. `M2_CharacterBase`, `BP_M2_PlayerCharacter` or `BP_M2Example_PlayerCharacter`, you will be affected at least by the change to the character movement component, even if you are not using any of the deprecated functionality. You will see the following popup when you open your character class. More details on this in [#resolving-the-corrupted-charactermovementcomponent](#resolving-the-corrupted-charactermovementcomponent "mention").

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

If any of these parts are relevant to your project, see [#how-to-fix](#how-to-fix "mention").

## What's changed, and why?

The following changes have been made to the `M2` character and morpheus actor (`M2_CharacterBase` and `M2M_CharacterBase`), meaning that if you are using blueprints based off of those classes, you will be impacted. If you are still using the deprecated character (extending e.g. `J_` classes or `Origin` classes), you will not be affected by this.

### Deprecated Anim Vars Component

The existing `JM_AnimVarsComponent` has now been deprecated, in favour of a stripped back `M2M_AnimVarsComponent`.

* The following anim vars have been removed:
  * `IsWalking`
  * `IsDoubleJumping`
  * `HasBeenLaunched`
  * `HasLowGravity`
  * `HasZeroGravity`
  * `IsMovingInLowGravity`
  * `IsThrustingUp`
  * `IsThrustingDown`
  * `IsBouncing`
  * `IsSliding`
  * `IsAiming`
* The following anim vars have been modified:\
  (These have been moved into being custom anim vars. For more details, see [#changes-to-gait-speeds](#changes-to-gait-speeds "mention")& [#changes-to-combat-mode](#changes-to-combat-mode "mention"))
  * `IsJogging`
  * `IsSprinting`
  * `IsInCombatMode`
  * `IsDead`

{% hint style="info" %}
In the deprecated `J_AnimInstance`, these are still accessible via the `DeprecatedAnimVars` variable
{% endhint %}

#### Modified ABP\_M2\_Human

`ABP_M2_Human`, our default anim instance, has been reparented from `J_AnimInstance` to `M2_AnimInstance`, and so no longer uses the deprecated anim vars. The old anim vars are still in use in the deprecated `ABP_M2_Human_OId`.

### Deprecated Character Movement Component

The existing `J_CharacterMovementComponent` has now been deprecated, in favour of using the native default `CharacterMovementComponent`.

* The following features have been removed:
  * The “Custom Movement Mode Primary Asset” system (see [#changes-to-custom-movement](#changes-to-custom-movement "mention"))
  * Some minor helper functions, like `AddGravityMultiplier` and `AddGaitSpeedMultiplier`
    * These could easily be added in the blueprint level in downstream projects if desired.
* The following features have been modified:
  * “Gait speeds” (see [#changes-to-gait-speeds](#changes-to-gait-speeds "mention"))
  * “Combat mode” (see [#changes-to-combat-mode](#changes-to-combat-mode "mention"))
* Due to `M2_CharacterBase`'s `Character Movement` class being changed (from `J_CharacterMovementComponent` to `CharacterMovementComponent`), unfortunately assets extending `M2_CharacterBase` will have their component corrupted. If this affects your character, you will see the following popup when attempting to play or open your asset.
  * For resolving this, see [#resolving-the-corrupted-charactermovementcomponent](#resolving-the-corrupted-charactermovementcomponent "mention")

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

### Changes to gait speeds

Gait speeds” are now no longer used as a core concept, and the `BPC_CharacterMoveSpeedComponent` has been deprecated. If you want to change your character’s walk speed, you can do so directly by calling your character movement component. We have an example of this in `BP_M2_PlayerCharacter` (for more details, see [The Example Character](/platform-documentation/creation/unreal-development/features-and-tutorials/the-m2-example-plugin/the-example-character.md))

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

Sprinting has been set as a custom variable now, instead of being a core anim var. You can add a similar custom variable for walking if you need it for your project (see [Custom Animation Variables](/platform-documentation/creation/unreal-development/features-and-tutorials/avatars/bespoke-character-animations.md#define-your-own-variables))

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

### Changes to "combat mode"

Similar to above, `IsInCombatMode` and `IsDead` have been converted to BP custom anim vars, and are used in our `M2Extras: CombatExample` plugin

<figure><img src="/files/6mkD8V5IT0hPtVJttFUb" alt=""><figcaption></figcaption></figure>

### **Changes to "custom movement"**

The deprecated “Custom Movement Mode Primary Asset” system is no longer used. It has not been documented, and has not been actively maintained by MSquared for years.

Note that Unreal’s custom movement modes are still available. Custom physics will need to be provided if so, in the `UpdateCustomMovement` event on your pawn

<figure><img src="/files/DpECfRkA7dkLEg5OkVqj" alt=""><figcaption><p>For reference - the node on the left is exclusive to the <code>J_CharacterMovementComponent</code>, and so has been deprecated and removed from our base class. The node on the right is native Unreal's way of handling custom movement, and will still be available</p></figcaption></figure>

<figure><img src="/files/fDYbQUwIxMsd0LivQkPK" alt=""><figcaption><p>A basic representative example of applying phyics to your custom movement mode in the native Unreal way</p></figcaption></figure>

### A diagram of the relevant classes

{% hint style="info" %}
Knowing the interaction of these classes is not essential, but this information has been provided if you want to know more about how the classes interact.
{% endhint %}

This diagram shows the changes to the assorted classes, and how they are related:

* `JM_AnimVarsComponent` has had a new base class introduced: `M2M_AnimVarsComponent`, which `M2M_CharacterBase` now points to
* `J_AnimInstance` has had a new base class introduced: `M2_AnimInstance`, which `ABP_M2_Human` now points to.
* `BPM_M2Example_PlayerCharacter` now uses a BP-level `BPMC_M2_AnimVarsComponent`, based off of the simplified base class, instead of using the deprecated anim vars.
* The deprecated BP classes (e.g. the `_Origin_` ones) will still point to the `J_` classes)

<figure><img src="/files/dFM8r2NMjsrFF0jP8TGd" alt=""><figcaption><p>A diagram outlining the various movement and animation components, and how they interact</p></figcaption></figure>

## How to fix

### **Resolving the corrupted CharacterMovementComponent**

{% hint style="warning" %}
NOTE: This breaking change is best fixed with knowledge of the project prior to upgrading. Please either check this flow before starting the upgrade, so you can make appropriate notes, or have access to a version of the project prior to the upgrade to hand, to easily compare between them.
{% endhint %}

The most significant action required is resolving the corrupted character movement component in classes extending `M2_CharacterBase`. You can fix it by doing the following:

* Open your actor class.
* If you see the following popup, that means your movement component was corrupted, and has been regenerated automatically.
  * (This is due to the parent class changing its default `CharacterMovementComponent` to be the base component rather than previously setting it to `J_CharacterMovementComponent`).

    <figure><img src="/files/o14wjNc9Zf3G0Qfjdaks" alt=""><figcaption></figcaption></figure>
* Review your auto-generated character movement component class. Since the movement component had to be regenerated, any manual changes to your previous movement component will have been reset.
  * Unfortunately, you won’t be able to compare changes via the diff, since the diffed version will have also been corrupted. Therefore, the best approach to get your changes to your character movement component class would be to either:
    * Make note of your changes to the movement component prior to the upgrade. You will be able to see any changes from the defaults since they will have the “undo arrow” by the property. Some edge cases to be aware of: `FaceLastAccelerationDirection` may be off, due to the `J_CharacterMovementComponent` making changes to this automatically. This should probably be set to true once moving off the `J_CharacterMovementComponent`. Also, make note of the `GaitSpeeds` values. `Jog` would be the default walk speed used, and you may want to re-add sprint to your project.

      <figure><img src="/files/DIQotmlfF91mEcsBAdHo" alt=""><figcaption></figcaption></figure>
    * Open a version of the project prior to the upgrade, to compare side-by-side, and add any changes back to the upgraded version of your class.
* **Save your asset** once you have reviewed your character. Even if you did not need to modify your movement component, the regenerated asset will need to be saved.

### If you accept the simplified base classes (recommended)

Our recommended approach would be to use the simplified components. Most of the deprecated anim variables, movement component additions and the like are not widely used, and could be re-added in downstream projects if desired.

If you accept the new base classes, and are using the `M2_CharacterBase`, `M2M_CharacterBase` and `ABP_M2_Human` already, all you will need to resolve would be the corrupted movement component (see [#resolving-the-corrupted-charactermovementcomponent](#resolving-the-corrupted-charactermovementcomponent "mention")).

If there are parts of the old functionality that you want to reintroduce into your project, this can be done at the blueprint level. A potential example would be if you want an equivalent to "gait speeds". We have an example flow of handling this in our `M2Example` plugin - including setting the movement speed on the native Unreal `CharacterMovementComponent`, and introducing a custom anim var to replicate the state and animate it for both regular and crowd characters. See [#changes-to-gait-speeds](#changes-to-gait-speeds "mention")

### If you want to keep using the deprecated classes (only recommended as a temporary solution)

If you want to use the deprecated anim vars, there are a number of places you will need to check:

{% hint style="info" %}
These components are tightly interlinked, so we strongly recommend switching wholesale, or moving all the componets wholesale back to the deprecated classes. (e.g. if you use the deprecated character movement component, but don't update the anim instance or anim vars, some animations may be missing, or other issues will be encountered)
{% endhint %}

* In your BPM, check the `AnimVarsComponentClass`. Make sure that it extends `JM_AnimVarsComponent`, or some child of that.

  <figure><img src="/files/c4nMCrJnBwIrXGMk2VOt" alt=""><figcaption></figcaption></figure>
* In your pawn, check your `Character Movement`'s details panel. Set it back to `J_CharacterMovementComponent`.\
  (If you want to keep values from before the breaking change, you will need to copy them across as outlined in [#resolving-the-corrupted-charactermovementcomponent](#resolving-the-corrupted-charactermovementcomponent "mention"), since this step will recreate the component)

  <figure><img src="/files/FM9gHU7nEkzoAOg8aWFB" alt=""><figcaption></figcaption></figure>
* In your pawn, check the mesh’s `AnimClass`. It will need to be set to an animation blueprint that extends `J_AnimInstance` instead of `M2_AnimInstance`

  <figure><img src="/files/j7VCOmNUmksCUV7GltU5" alt=""><figcaption></figcaption></figure>
* Check your pawn set. In its crowd entry, it will need to point to the a `SkeletalAnimatedCrowdData` that has the right anim instance

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

## How to test it?

Open your character asset. Then PIE to verify that your character begins play, and moves as expected. If you see the `Asset had a corrupted CharacterMovementComponent` popup in either of the above steps, you will need to go through the [#how-to-fix](#how-to-fix "mention") process.

We recommend also checking the animated crowd (e.g. by testing with multiple clients and setting the`PlayerClient.Rendering.NumInLOD0` live config override to 0), to ensure that it is also animating as expected.

If you previously used the `J_CharacterMovementComponent`, and are not using it any more, you may have compile errors if calling methods that are not present in `CharacterMovementComponent`. You should also search for attempts to cast to `J_CharacterMovementComponent` in your project. If there were any, they will fail.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.otherside.xyz/platform-documentation/creation/unreal-development/release-notes/breaking-changes-further-details/breaking-change-details-deprecating-j_charactermovementcomponent-and-jm_animvarscomponent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
