No suitable user-defined conversion from "FVector2D" to "FVector" exists

In void ATankgoPlayerController::AimTowardsCrosshair() you are calling the GetSightRayHitLocation() function with only 1 parameter specified when the function declaration requires two.

// GetSightRayHitLocation Declaration.

bool GetSightRayHitLocation(FVector2D ScreenLocation, FVector& OutHitLocation) const;

//Your usage of GetSightRayHitLocation

void ATankgoPlayerController::AimTowardsCrosshair()
{

if (!GetControlledTank()) { return; }

FVector OutHitLocation; //Out parameter

if (GetSightRayHitLocation(OutHitLocation)) // No default parameters specific in function Definition
{
	GetControlledTank()->AimAt(OutHitLocation);
}

}

I think this may be the formal parameter error message issue.

Change to:

if(GetSightRayHitLocation(ScreenLocation, OutHitLocation))
{
GetControlledTank()->AimAt(OutHitLocation);
}

Yeah, i think your close, it created a formal parameters error.

Ah, I see the problem, you take ScreenLocation as a parameter in the function GetSightRayHitLocation(FVector2D ScreenLocation, FVector& OutHitLocation).

You then redefine the ScreenLocation variable auto ScreenLocation = FVector2D(ViewportSizeX * CrosshairXLocation, ViewportSizeY * CrosshairYLocation);

That’s your formal redefinition. Remove the auto keyword or change the line auto ScreenLocation = FVector… to anything else that doesn’t conflict and it should successfully compile. :slight_smile:

Ah, I see the problem, you take
ScreenLocation as a parameter in the
function
GetSightRayHitLocation(FVector2D
ScreenLocation, FVector&
OutHitLocation).

You then redefine the ScreenLocation
variable auto ScreenLocation =
FVector2D(ViewportSizeX
CrosshairXLocation, ViewportSizeY
CrosshairYLocation);

That’s your formal redefinition.
Remove the auto keyword or change the
line auto ScreenLocation = FVector…
to anything else that doesn’t conflict
and it should successfully compile. :slight_smile: --Ryuuchi

Yeah, that got it, thanks. Its tough having to debug these out of date tutorials, but its good experience.