How to get default subobject in pawn

How do I get the default subobject of ASomePawn?

ASomePawn::ASomePawn(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<USomeComponent>("Some Component"))
    PrimaryActorTick.bCanEverTick = true;

I meant the USomeComponent i set as default subobject from

Super(ObjectInitializer.SetDefaultSubobjectClass<USomeComponent>("Some Component")

I’m not sure what you mean, but I’m going to take a guess and say you’re looking for the RootComponent which you can access just by typing RootComponent.

Edit: Okay, I understand now. There are two ways to go about this. You can either call GetComponentByClass every time you need to use the component…or you can go the more efficient route. Depending on which level of access you want, add UPROPERTY() USomeComponent* SomeComponent; into your pawn’s header file. From there, instead of using SetDefaultSubobject, use SomeComponent = CreateDefaultSubobject(TEXT("SomeComponent"));

Added and Edit to the answer that should give you what you’re looking for. Hope it helps.