Can't edit Character Movement Component when using SetDefaultSubobjectClass

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

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

And in the constructor add:

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.

1 Like