mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 08:02:23 -07:00
Add target acquisition in the sample
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "CogDefines.h"
|
||||
#include "CogSampleCharacter.h"
|
||||
#include "CogSampleTargetAcquisition.h"
|
||||
#include "Net/UnrealNetwork.h"
|
||||
|
||||
#if USE_COG
|
||||
@@ -38,4 +39,18 @@ void ACogSamplePlayerController::AcknowledgePossession(APawn* P)
|
||||
{
|
||||
PossessedCharacter->OnAcknowledgePossession(this);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void ACogSamplePlayerController::Tick(float DeltaSeconds)
|
||||
{
|
||||
Super::Tick(DeltaSeconds);
|
||||
|
||||
if (TargetAcquisition != nullptr)
|
||||
{
|
||||
TArray<AActor*> TagretToIgnore;
|
||||
FCogSampleTargetAcquisitionResult Result;
|
||||
TargetAcquisition->FindBestTarget(this, TagretToIgnore, nullptr, true, FVector2D::ZeroVector, false, Result);
|
||||
Target = Result.Target;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user