Are ProjectWorldToScreen and DrawLine using different coordinate systems?

I’ve been doing some reading in the UMG part of the documentation, in particular about scaling. The problem is indeed that Project World to Screen and Draw Line uses different screen coordinate systems. We can convert between them by dividing by or multiplying with Get Viewport Scale.

There is also Project World Location to Widget Position which does that for us. I get the line I want when I replace Project World to Screen with Project World Location to Widget Position.

While not explicitly stated in the user manual, at least that I could find, I got some hints from
Scale UI for Different Devices | Unreal Engine Documentation and
DPI Scaling | Unreal Engine Documentation, which along with the ever useful search box that appears when right-clicking in a Blueprint helped me find the nodes I needed.

1 Like