Offset in Convert World Location to Screen Location

Sorry to resurrect but I was facing this same issue in Slate/C++ on UE 5.5 and translating your BP logic to C++ actually worked in my case!

		FVector2D ViewportSize;
		ViewportClient->GetViewportSize(ViewportSize);
		float ViewportScale = GetDefault<UUserInterfaceSettings>()->GetDPIScaleBasedOnSize(FIntPoint(FMath::TruncToInt32(ViewportSize.X), FMath::TruncToInt32(ViewportSize.Y)));
		ScreenPosition /= ViewportScale;

The ScreenPosition variable from above was the result from UGameplayStatics::ProjectWorldToScreen.

1 Like