# NULL CharacterMovement component when switching from custom back to default

**URL:** <https://forums.unrealengine.com/t/null-charactermovement-component-when-switching-from-custom-back-to-default/407101>\
**Category:** C++\
**Tags:** charactermovementcom, unreal-engine, null, Blueprint, question, CPP\
**Created:** [October 15, 2017, 11:21pm UTC](https://forums.unrealengine.com/t/null-charactermovement-component-when-switching-from-custom-back-to-default/407101 "2017-10-15T23:21:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlaelgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tlaelgames](https://forums.unrealengine.com/u/tlaelgames)\
**Post date:** [October 15, 2017, 11:21pm UTC](https://forums.unrealengine.com/t/null-charactermovement-component-when-switching-from-custom-back-to-default/407101/1 "2017-10-15T23:21:37Z")

</div>

NULL CharacterMovement component when switching from custom back to default

Build Type: Binary

Build Version: Version: 4.17.2-3658906+++UE4+Release-4.17

When using a custom CharacterMovementComponent for the ACharacter class, downgrading to a default CharacterMovementComponent later will break existing blueprints that use the character. After switcing up the constructor arguments and reloading the project, the character blueprints will have a NULL MovementComponent that can not be fixed (since it’s a private, inherited component).

Repro steps:

- Start with ShooterGame template project
- View the PlayerPawn blueprint in the editor and notice how it has a valid CharacterMovementComponent
- Edit the source code for AShooterCharacter::AShooterCharacter:

Change this code:

`
          AShooterCharacter::AShooterCharacter(const FObjectInitializer& ObjectInitializer)
        	: Super(ObjectInitializer.SetDefaultSubobjectClass(ACharacter::CharacterMovementComponentName))
      {
`

To this:

`
      AShooterCharacter::AShooterCharacter(const FObjectInitializer& ObjectInitializer)
      {
`

This code change should make the ShooterCharacter use the standard UCharacterMovementComponent instead of the derived UShooterCharacterMovement

- Compile the code and go back to the editor
- View the PlayerPawn blueprint and notice that it still has a valid CharacterMovementComponent
- Close the editor
- Reopen the project in the editor
- View the PlayerPawn blueprint – It doesn’t have a CharacterMovementComponent!
- Run the game – It crashes due to NULL component
- These constructor initializers also produce a NULL movement component:

`
    : Super(ObjectInitializer)
   : Super(ObjectInitializer.SetDefaultSubobjectClass(ACharacter::CharacterMovementComponentName))
`
- Note that, while the PlayerPawn blueprint is in its bugged state, you can create a new blueprint that uses the ShooterCharacter as its parent. This new blueprint will have a valid, non-null movement component.

---

<div class="post-metadata">

**Author:** ![Reuben\_Ward](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Reuben\_Ward](https://forums.unrealengine.com/u/Reuben_Ward)\
**Post date:** [September 24, 2019, 12:19pm UTC](https://forums.unrealengine.com/t/null-charactermovement-component-when-switching-from-custom-back-to-default/407101/2 "2019-09-24T12:19:31Z")

</div>

This needs to be fixed. This has been frustrating me for the past 2 hours, glad someone else has found this.

---

<div class="post-metadata">

**Author:** ![xuanyuan52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xuanyuan52](https://forums.unrealengine.com/u/xuanyuan52)\
**Post date:** [September 8, 2021, 2:26am UTC](https://forums.unrealengine.com/t/null-charactermovement-component-when-switching-from-custom-back-to-default/407101/3 "2021-09-08T02:26:34Z")

</div>

I have the same problem, Did you solve it?

---

<div class="post-metadata">

**Author:** ![xuanyuan52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xuanyuan52](https://forums.unrealengine.com/u/xuanyuan52)\
**Post date:** [September 8, 2021, 8:58am UTC](https://forums.unrealengine.com/t/null-charactermovement-component-when-switching-from-custom-back-to-default/407101/4 "2021-09-08T08:58:28Z")

</div>

I solved it by redirecting  
[CoreRedirects]  
+ClassRedirects=(OldName=“Your custom movementcomponent”,NewName=“You new movementcomponent”)
