@mdeni (mdeni) posted a new topic, subject "Access to bUseAccelerationForPaths from C++". It read:

   Thank you for the hint  I found excellent example in the source code of UnrealTournament (UTCharacter.cpp).  
    BTW, Your twitch streams about AI are awesome! Can't wait next stream

To which @mdeni (mdeni) replied

    Hi!
    
    I can't access to UNavMovementComponent8b7c:f320:99b9:690f:4595:cd17:293a:c069UseAccelerationForPaths from C++ code since it's declared as protected member.
    [code] 
        1>..\Source\MedievalTales\Characters\GameCharacter.cpp(44): error C2248: 'UNavMovementComponent8b7c:f320:99b9:690f:4595:cd17:293a:c069UseAccelerationForPaths': cannot access protected member declared in class 'UNavMovementComponent'
        1>C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Engine\Classes\GameFramework/NavMovementComponent.h(44): note: see declaration of 'UNavMovementComponent8b7c:f320:99b9:690f:4595:cd17:293a:c069UseAccelerationForPaths'
        1>C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Engine\Classes\GameFramework/NavMovementComponent.h(25): note: see declaration of 'UNavMovementComponent'
        
    [/code]
    
    I have access to it only from Blueprints  Please make it as public class member.

Then @MieszkoZ (MieszkoZ) said

    All you need to do is to extend the movement component in your code and set `bUseAccelerationForPaths` to whatever your heart desires, or even add an accessor function. No need to change engine-level code.
    
    Cheers,
    
    –mieszko

To which @kimducbk (kimducbk) replied

    I am still stuck in this problem, Could you share your solution in detail

So @mdeni (mdeni) replied

    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:
    
    UGameCharacterMovementComponent8b7c:f320:99b9:690f:4595:cd17:293a:c069UGameCharacterMovementComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)  
    {  
    bUseAccelerationForPaths = true;  
    }
    
      3. Replace default character movement component by your:
    
    AGameCharacter8b7c:f320:99b9:690f:4595:cd17:293a:c069GameCharacter(const FObjectInitializer& ObjectInitializer)  
    : Super(ObjectInitializer.SetDefaultSubobjectClass(ACharacter8b7c:f320:99b9:690f:4595:cd17:293a:c069haracterMovementComponentName))
    
      4. That is all.

@kimducbk (kimducbk) replied

    This solved my problems. Thank you so much bro.
    
    Cheers,


{'source': 'discourse', 'url': 'https://forums.unrealengine.com/t/access-to-buseaccelerationforpaths-from-c/401046', 'title': 'Access to bUseAccelerationForPaths from C++', 'views': 356, 'has_accepted_answer': False, 'word_count': 247, 'like_count': 0, 'reply_count': 4, 'participant_count': 3, 'posts': 6, 'tags': 'question CPP bug-report Navigation', 'author': '@mdeni (mdeni)', 'participants': '@mdeni (mdeni), @MieszkoZ (MieszkoZ), @kimducbk (kimducbk)', 'image_url': [None], 'created_at': '2017-08-02T10:08:37.000Z', 'last_posted_at': '2019-05-13T02:02:36.000Z'}