Download

SimpleMoveToLocation does not work with AIController

Hey, I have created 2 classes. One which derives from AIController and one which derives from ACharacter.
On the AIController I spawn the ACharacter in the BeginPlay function and posses it to the controller:



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

	AViking* vi = GetWorld()->SpawnActor<AViking>(vikingBp, FVector(750, 1000, 200), FRotator::ZeroRotator);
	Possess(vi);
}


On the ACharacter Class I have:


NavSys->SimpleMoveToLocation(Cast<AAIController>(GetController()), hit.ImpactPoint);

I have nav mesh on the editor and weird think happens.
I set a target position which the character suppose to get there by SimpleMoveToLocation and where it interacts with the cube the character stops moving:
j8vfnvC.png

goA9HU0.png

Moreover, when I change the AIController to AController it works fine! (and the casting too of curse).
So the problem is in the AIController, why?

UP…

Is your Nav mesh big enough? Is the pawn blocked by something (An extra collision mesh for example?)?