World to Screen Location

Could you post a sample code of how did you accomplish it?

Sorry, that was really just a dirty fix by adding 43 to the y-coordinate of the screen position… If you take normal screenshots you can see the black bar. If you then draw a horizontal line at 43 pixels y-coordinate it should be exactly the end of the bar.

Hi all!

I’m trying to project 3D world coordinates onto a 2D screen. From a screenshot (with the same resolution as the viewport) I tried to draw a bounding box around my actors from the projected points. It seems now that I get wrong 2D points. In the beginning the calculated 2D points were different. Now only the y-coordinate has changed.

Can someone help me? Every 2D point is missing around 43 pixels in y-direction…

Thank you so much and regards

Are you asking how to calculate world to screen location? I’m not sure but try using UGameplayStatics::ProjectWorldToScreen function.

Thank you! I already figured out the problem now! I already used ProjectWorldToScreen, but the HighRes Screenshots didn’t show the black bar at the top and the bottom of every image. But these 43 Pixels were exactly the problem to get the correct point on my image… Thanks though :slight_smile: