Hi. I’m using Unreal 4.20.3.
I’m finding it a bit tough implementing MoveToActor on an AIController.
It doesn’t seem like it should be too complicated.
It’s a basic dogfight game where I want the Enemy planes to be possessed by the AIController and follow the Player plane.
In the EnemyPlane blueprint I set auto posses AI to “Placed in world or spawned”.
Initially I had APawn as the base class for the Enemy and Player planes but then I made it character.
In EnemyAIController I have the following code in BeginPlay:
if(GetWorld())
{
ACharacter* playerChar = GetWorld()->GetFirstPlayerController()->GetCharacter();
MoveToActor(playerChar, 1.0f, true, true, true, DefaultNavigationFilterClass, true);
}
But this doesn’t seem to be adequate the EnemyPlanes don;'t seem to head toward the Player plane and definitely don’t change direction when the Player plane moves in the world.
One question I had was if MoveToActor should be called just the once or does it need to be constantly updated eg. in Tick.
The other thing I was wondering is if a Behaviour Tree needed to be implemented in this setting - i haven’t really used them before.
Thanks.
J