GetActorsInSelectionRectangle - Mouse position off

Hi everyone.

Having an issue with GetMousePosition and using it with GetActorsInSelectionRectangle.

I’ve used the same vector2 cords for my DrawRect and that works good. I know DPI might be the issue. But I’ve tired to get the mouse cords by GetMousePositionScaledByDPI however that didn’t work with DrawRect.

Anybody have any ideas why its not correct?

Heres some screenshots -

Nevermind, I realised after reading the screen shot. I needed to hoist the GetMousePosition function outside of the if…

Sorry for not seeing it at first.