Access to bUseAccelerationForPaths from C++

Hi! It’s simple:

  1. Create you own component derived from UCharacterMovementComponent. For example:

    UCLASS()
    class MEDIEVALTALES_API UGameCharacterMovementComponent : public UCharacterMovementComponent
    {
    GENERATED_UCLASS_BODY()
    };

  2. Setup this parameter in constructor:

    UGameCharacterMovementComponent::UGameCharacterMovementComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
    {
    bUseAccelerationForPaths = true;
    }

  3. Replace default character movement component by your:

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

  4. That is all.

1 Like