Unable to cast AAIController to AController

I’m having an issue with casting AAIController to AController:

void UBlackboardService::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
    Super::TickNode(OwnerComp, NodeMemory, DeltaSeconds);
    AController* pawnController;
    pawnController = Cast<AController>(OwnerComp.GetAIOwner());

This is giving me this error message:

Error 2 error C2664: ‘AController TCastImpl ::DoCast(UObject )’ : cannot convert argument 1 from 'AAIController ’ to 'UObject ’ C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\CoreUObject\Public\Templates\Casts.h 135 1 LostEchoes

You don’t need casting in this case, you should be able to just assign it.



Oooh, haha, silly mistake. Thanks!