Create Test Enemy
This commit is contained in:
parent
141ac232f0
commit
0917e54fdd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -22,6 +22,13 @@ void AVampireAIController::BeginPlay()
|
||||||
void AVampireAIController::Tick(float DeltaTime)
|
void AVampireAIController::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
if (AVampireCharacter* Player = Cast<AVampireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0)))
|
||||||
|
{
|
||||||
|
Blackboard->SetValueAsObject("Player", Player);
|
||||||
|
auto location = Player->GetActorLocation();
|
||||||
|
Blackboard->SetValueAsVector("PlayerLocation", location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVampireAIController::OnPossess(APawn* InPawn)
|
void AVampireAIController::OnPossess(APawn* InPawn)
|
||||||
|
@ -38,7 +45,6 @@ void AVampireAIController::OnPossess(APawn* InPawn)
|
||||||
Blackboard->InitializeBlackboard(*bt->BlackboardAsset);
|
Blackboard->InitializeBlackboard(*bt->BlackboardAsset);
|
||||||
BehaviorTree->StartTree(*bt);
|
BehaviorTree->StartTree(*bt);
|
||||||
Blackboard->SetValueAsObject("SelfActor", EnemyCharacter);
|
Blackboard->SetValueAsObject("SelfActor", EnemyCharacter);
|
||||||
Blackboard->SetValueAsObject("Player", UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue