How do I add an actorcomponent to pawn, docs and google are confusing

Hello, in your header file of your character:

  1. #include “PawnSteeringComponent.h” right before the generated.h

  2. Create the following uproperty:

    UPROPERTY(VisibleAnywhere)

    UPawnSteeringComponent* ActorComp;

then. switch to your source file and in your constructor type in the following line:

ActorComp = CreateDefaultSubobject<UPawnSteeringComponent>(TEXT("MyActorCompName"));

-Orfeas