The specification of the LineTraceSingleByObjectType function has changed
And nothing is said in the corresponding lesson - 121 of section 3.
The Hit argument is no longer a “FHitResult”, it is a TArray
It should be changed.
I am with version 4.25.4 (updated yesterday (23/Oct/2020) with 3 Gb more) from 4.25.3.
The given solution evidently does not compile.
I have to create another solution
// LineTraceMultiByObjectType Parameters
TArray<FHitResult> OutHit;
FCollisionObjectQueryParams CollisionObjectQuery(ECollisionChannel::ECC_PhysicsBody); // Collision Channel we are using
FCollisionQueryParams TraceParams(
FName(TEXT("")), // now in blank
false, // bool bImTraceComplex
// GetWorld()->GetFirstPlayerController()->GetPawn() // const AActor InIgnoreActor; // Actor to ignore, ourseleves
// If you remember is the Owner of the Grabber Component
GetOwner()
);
bool Res = GetWorld()->LineTraceMultiByObjectType(
OUT OutHit,
IN PlayerViewPointLocation, // Start
IN LineTraceEnd,
IN CollisionObjectQuery,
IN TraceParams
);
// Log out the Actor hit
// See what it hits
if (Res)
{
UE_LOG(LogTemp, Warning, TEXT("Hit with [%s] Location: [%s]"),
*OutHit[0].GetActor()->GetName(),
*OutHit[0].ImpactPoint.ToString(),
*OutHit[0].ImpactNormal.ToString()
);
}
I hope you will change it
…