GetOwner is returning null

antonio_gamedev
Wed, 22 Jul 2020 06:24:22 +0000
C++

Hello, when I call the method GetOwner in the BeginPlay method I get a null pointer.
This is only the code of the BeginPlay method. I have no idea why it is null. Can you give some hint?

void ASTrackerBot::BeginPlay()
{
	Super::BeginPlay();


	AActor* MyOwner = GetOwner();
	if (MyOwner == nullptr)
	{
		UE_LOG(LogTemp, Log, TEXT("Id null"));
	}

}

5 posts - 1 participant