void AController::UpdateNavigationComponents() { UPathFollowingComponent* PathFollowingComp = FindComponentByClass<UPathFollowingComponent>(); if (PathFollowingComp != NULL) { PathFollowingComp->UpdateCachedComponents(); } }
void AController::UpdateNavigationComponents() { UNavigationComponent* PathFindingComp = FindComponentByClass<UNavigationComponent>(); if (PathFindingComp != NULL) { PathFindingComp->OnNavAgentChanged(); PathFindingComp->UpdateCachedComponents(); } UPathFollowingComponent* PathFollowingComp = FindComponentByClass<UPathFollowingComponent>(); if (PathFollowingComp != NULL) { PathFollowingComp->UpdateCachedComponents(); } // initialize movement mode in characters ACharacter* MyCharacter = Cast<ACharacter>(GetPawn()); if (MyCharacter && MyCharacter->CharacterMovement) { MyCharacter->CharacterMovement->SetDefaultMovementMode(); } }