Legacy/Custom Character Movement Component

Overview Author: () Dear Community, If you look at CharacterMovementComponent.h the vast majority of the functions are virtual! This is great news! You can easily create custom character movement b...

Overview

Author: ()

Dear Community,

If you look at CharacterMovementComponent.h the vast majority of the functions are virtual!

This is great news!

You can easily create custom character movement behaviors.... if you can get your characters to use your custom CharacterMovementComponent class!

Here's how you can do it!

Character Constructor (UE >4.6)

First, replace

AVictoryPlayerCharacterBase::AVictoryPlayerCharacterBase(const class FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer)
{   
        //this is your regular constructor code
}

with (where ACharacter::CharacterMovementComponentName is a string of type FName):

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

Character Constructor (UE \CallFunction();

}



## Conclusion

Now you know how to create entirely custom movement systems for your UE4 Characters\!

Enjoy\!

`()`
Hoodini Hoodini Bot Last updated on