0

I'm trying to extract the mouse position from FPointerEvent, but no matter what, it always return the coordinate of (0,0).

Note that I'm aware of APlayerController::GetMousePosition() function, but I'll be implement the same to dragging UMG so getting mouse properties from player controller won't work

code

Btw, I'm using UE5

Hung Quang
  • 40
  • 1
  • 6
  • 1
    Screenspace position is a vector of 2 `float`s but you are trying to print 2 `int` with `"%d,%d"`. Change `TEXT("%d,%d")` to `TEXT("%f,%f")` – UnholySheep Sep 20 '21 at 14:58
  • 1
    Alternatively you could also use the `ToString` function with `TEXT("%s"), *InMouseEvent.GetScreenSpacePosition().ToString()` – UnholySheep Sep 20 '21 at 15:02
  • 1
    damn, I'm now informed. It costs me a day swearing at the engine. How silly, thanks for help man – Hung Quang Sep 20 '21 at 16:21

0 Answers0