Custom character component classes

I got help from the unrealengine subreddit on reddit.com.

The answer is to chain the functions. Since Objectinitializer.SetDefaultSubobjectClass returns an Objectinitializer, you can then do the same thing to that one.

This leaves you with:

AVictoryPlayerCharacterBase::AVictoryPlayerCharacterBase(const FObjectInitializer& ObjectInitializer)
     : Super(ObjectInitializer.SetDefaultSubobjectClass<UVictoryCharMoveComp>(ACharacter::CharacterMovementComponentName).SetDefaultSubobjectClass<UVictorySkelMoveComp>(ACharacter::MeshComponentName))
 {
3 Likes