A litle improvement

Make sure your aim doesn’t hit the player tank, e.g. the barrel.

FCollisionQueryParams TraceParameters = FCollisionQueryParams(FName(TEXT("")), false, GetControlledTank());
if (GetWorld()->LineTraceSingleByChannel(HitResult, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility, TraceParameters))
{
	HitLocation = HitResult.Location;
	return true;
}

hitting yourself
image

problem solved

Privacy & Terms