void UBlinkyChaseBehaviorComponent::FindPath()
{
	auto Owner = static_cast<AGhost*>(GetOwner());
	auto PathFollower = Owner->GetPathFollowingComponent();

	TActorIterator<APacmanPlayer> PlayerIt(GetWorld());

	GNavigationSystem->FindPathToLocation(Owner->GetActorLocation(), PlayerIt->GetActorLocation(), Owner->GetActorForwardVector(), PathFollower->GetPath());
	PathFollower->StartPathFollowing();
}
void ARealmMoveController::Possess(APawn* inPawn)
{
	Super::Possess(inPawn);

	AGameCharacter* gc = Cast<AGameCharacter>(inPawn);
	URealmCrowdComponent* cc = Cast<URealmCrowdComponent>(GetPathFollowingComponent());
	if (IsValid(gc) && IsValid(cc))
	{
		cc->AvoidanceGroup.SetFlagsDirectly(gc->GetTeamIndex());
		cc->GroupsToAvoid.SetFlagsDirectly(gc->GetTeamIndex());
		cc->UpdateCrowdAgentParams();
	}
}
예제 #3
0
bool AAIController::ShouldPostponePathUpdates() const
{
    return GetPathFollowingComponent()->HasStartedNavLinkMove() || Super::ShouldPostponePathUpdates();
}