Has anyone else received an error when trying to use this as the first argument in SuggestProjectileVelocity?
if (UGameplayStatics::SuggestProjectileVelocity(this, LaunchVelocity, ChopperGunBarrel->GetComponentLocation(), TargetLocation, LaunchSpeed))
{
UE_LOG(LogTemp, Warning, TEXT("Aim Direction: %s"), *LaunchVelocity.ToString());
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Can't AIM!"));
}
Reults in this error:
ActorComponent_ChopperAiming.cpp(49) : error C2664: 'bool UGameplayStatics::SuggestProjectileVelocity(UObject *,FVector &,FVector,FVector,float,bool,float,float,ESuggestProjVelocityTraceOption::Type,const FCollisionResponseParams &,const
TArray<AActor *,FDefaultAllocator> &,bool)': cannot convert argument 1 from 'const UActorComponent_ChopperAiming *const ' to 'UObject *'
My aiming component is an ActorComponent, just like Ben’s…