MCPcopy Create free account
hub / github.com/arnaud-jamin/Cog / TickTargeting

Method TickTargeting

Source/CogSample/CogSamplePlayerController.cpp:149–171  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

147
148//--------------------------------------------------------------------------------------------------------------------------
149void ACogSamplePlayerController::TickTargeting(float DeltaSeconds)
150{
151 if (IsLocalController())
152 {
153 if (TargetAcquisition == nullptr)
154 {
155 SetTarget(nullptr);
156 return;
157 }
158
159 TArray<AActor*> TargetToIgnore;
160 FCogSampleTargetAcquisitionResult Result;
161 TargetAcquisition->FindBestTarget(this, TargetToIgnore, nullptr, true, FVector2D::ZeroVector, false, Result);
162 SetTarget(Result.Target);
163 }
164
165#if ENABLE_COG
166 if (Target != nullptr && PossessedCharacter != nullptr)
167 {
168 FCogDebugDraw::Segment(LogCogTargetAcquisition, this, PossessedCharacter->GetActorLocation(), Target->GetActorLocation(), FColor::White, false);
169 }
170#endif //ENABLE_COG
171}
172
173//--------------------------------------------------------------------------------------------------------------------------
174void ACogSamplePlayerController::SetTarget(AActor* Value)

Callers

nothing calls this directly

Calls 1

FindBestTargetMethod · 0.80

Tested by

no test coverage detected