Ok, I added the next code inside UTankAimingComponent::AimAt and before the bHaveAimSolution condition !!
auto TankName = GetOwner()->GetName();
UE_LOG(LogTemp, Warning, TEXT("*** Tank Name is %s"), *TankName);
Full Code …
void UTankAimingComponent::AimAt(FVector HitLocation, float LaunchSpeed)
{
if (!Barrel) { return; }
FVector OUT LaunchVelocity;
FVector StartLocation = Barrel->GetSocketLocation(FName("Projectile"));
auto TankName = GetOwner()->GetName();
UE_LOG(LogTemp, Warning, TEXT("*** Tank Name is %s"), *TankName);
bool bHaveAimSolution = UGameplayStatics::SuggestProjectileVelocity
(
this,
LaunchVelocity,
StartLocation,
HitLocation,
LaunchSpeed,
ESuggestProjVelocityTraceOption::DoNotTrace
);
if (bHaveAimSolution)
{
auto TankName = GetOwner()->GetName();
auto AimDirection = LaunchVelocity.GetSafeNormal();
UE_LOG(LogTemp, Warning, TEXT("*** Tank Name is %s, AimDirection is %s"), *TankName, *AimDirection.ToString());
}
}
Look at the Logout