# Can't edit Character Movement Component when using SetDefaultSubobjectClass

**URL:** <https://forums.unrealengine.com/t/cant-edit-character-movement-component-when-using-setdefaultsubobjectclass/453608>\
**Category:** Character & Animation\
**Tags:** unreal-engine, CPP, question\
**Created:** [August 9, 2019, 5:01am UTC](https://forums.unrealengine.com/t/cant-edit-character-movement-component-when-using-setdefaultsubobjectclass/453608 "2019-08-09T05:01:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Darcey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Darcey](https://forums.unrealengine.com/u/Ryan_Darcey)\
**Post date:** [August 9, 2019, 5:01am UTC](https://forums.unrealengine.com/t/cant-edit-character-movement-component-when-using-setdefaultsubobjectclass/453608/1 "2019-08-09T05:01:12Z")

</div>

I recently upgraded from 4.18 to 4.22.3 and found that I can no longer edit my custom Character Movement Component on my custom character class. I originally followed Rama’s instructions here to have my PFCharacter class use my UPFCharacterMovementComponent:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

```
APFCharacter::APFCharacter(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer.SetDefaultSubobjectClass<UPFCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))

```

the result in 4.22.3 is that everything functions perfectly in game based on the values I set before the 4.22.3 upgrade, but when I select the component in editor I can’t edit any properties.

I should note…creating a new non-custom Character results in me being able to edit the non-custom movement component just fine.

Yikes! Any ideas?

 ![284576-charmove.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/2/8c2158e079c8862ba053f07dd62067de5d2da6cb.png)

---

<div class="post-metadata">

**Author:** ![Ryan\_Darcey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Darcey](https://forums.unrealengine.com/u/Ryan_Darcey)\
**Post date:** [August 9, 2019, 3:32pm UTC](https://forums.unrealengine.com/t/cant-edit-character-movement-component-when-using-setdefaultsubobjectclass/453608/2 "2019-08-09T15:32:12Z")

</div>

Quick work around update … opened up my character in the Property Matrix on a whim and can see properties in there! Seems to be a property visibility issue in the blueprint editor view.

 ![284648-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/8/96806133d476e165536dbfe02f58e52be1a8fd41.png)

---

<div class="post-metadata">

**Author:** ![Ryan\_Darcey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Darcey](https://forums.unrealengine.com/u/Ryan_Darcey)\
**Post date:** [August 9, 2019, 4:09pm UTC](https://forums.unrealengine.com/t/cant-edit-character-movement-component-when-using-setdefaultsubobjectclass/453608/3 "2019-08-09T16:09:29Z")

</div>

The weirdness continues…I can also edit character movement component properties on my character placed in the level.

 ![284649-charinlevel.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/3/5132f03e8b29238b87cbdddbf44bcac9319e2011.jpeg)

---

<div class="post-metadata">

**Author:** ![Pampersrocka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pampersrocka](https://forums.unrealengine.com/u/Pampersrocka)\
**Post date:** [August 31, 2022, 12:12pm UTC](https://forums.unrealengine.com/t/cant-edit-character-movement-component-when-using-setdefaultsubobjectclass/453608/4 "2022-08-31T12:12:13Z")

</div>

As this is still the case in UE5, the solution for this problem is, that you also need to declare a variable with your new movement component and assign it:  
In you header of your character, add something like

```nohighlight
class AMyCharacter : public ACharacter
{
    //....
   UPROPERTY(BlueprintReadOnly, VisibleAnyhwere)
   TObjectPtr<UMyMovementComponent> MyMovementComponent;
}

```

And in the constructor add:

```nohighlight
AMyCharacter::AMyCharacter(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer.SetDefaultSubobjectClass<UMyMovementComponent>(ACharacter::CharacterMovementComponentName))
{
   MyMovementComponent = Cast<UMyMovementComponent>(GetCharacterMovement());
}

```

The component will then show up as `MyMovementComponent` in the Blueprint Editor as it uses the new variable instead of the one defined in `ACharacter`.
