Unable to repeat the same steps using UE4 3rd person template

Hello,
I completed the course and did also the mega challenge.
I learned a lot and now I’m going back to try to repeat some steps that I found particularly interesting, including this lesson that implements the AI controller.
Let me say that in your course everything worked perfectly, the character rotated and followed the player pawn.
I tried to do the exactly the same thing but starting from the 3rd person character template available when creating a new UE4 project. I did the following steps :

  1. I created MyAIController.cpp
#include "MyAIController.h"
#include "Kismet/GameplayStatics.h"

void AMyAIController::BeginPlay()
{
	Super::BeginPlay();
	APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
	if (PlayerPawn != nullptr)
	{
		UE_LOG(LogTemp, Warning, TEXT("Set of Focus OK"));
		SetFocus(PlayerPawn);
	}
}
  1. I created MyAIController_BP from MyAIController.cpp
  2. I set ThirdPersonCharacter->AI Controller Class -> MyAIController_BP;
  3. I spawned a ThirdPersonCharacter in the scene but it doesn’t rotate to follow player pawn as it should.
    It all seems the same to me as the course code.
    Any idea where the error could be ?

https://youtu.be/2t4rNeYmv6Y

Problem solved. Thank you for the support.

Privacy & Terms