How to set the position of a movable widget inside of a world space widget component to the mouse position?

I’m trying to make a widget that I can drag around with the mouse, but my widget is in world space, not the viewport.

I have tried everything I can think of, plus any tutorial I could find (They work when the widget is in the viewport, but not when it’s in world space.)

Higharchy example of the widget that the widget component is using:

  • Canvas panel.
    –Widget I want to move around in the canvas panel.

I’ll post some pictures and videos of my attempts and the result I’m getting.

Method 1: I’m not quite sure why it lags behind.


Method 2: This clearly shows my lack of understanding and ability to covert the viewport space to the coordinates inside the canvas.


I’ll be extremely grateful for any help I receive, even if it’s only asking me why I’m doing some of the stupid things I’m doing. Thank you.

Look at this, please.

My Products

I’m hesitant to try the first solution you posted because as shown in your video, it seems to suffer the same lag as the first one I posted.
As for the second one, it functioned much like the second one I posted. Not sure if I did something wrong, or if it just doesn’t work anymore.

Hey Estrange. did you ever found a solution for this one?

A perfect solution? No.
The best result you will get, (using a widget component) will lag like the ones Supremative showed off above (I didn’t use those methods, I made my own and it too lags).

To my understanding, the widget component is slow and renders about 1 second behind.
I did a small amount of looking to see if anyone had a faster way of rendering a widget to a mesh, but I quickly gave up. Currently, I’ve gone with the option to mitigate the appearance of lag by making my mouse cursor invisible and using an image as a fake cursor (much harder to tell it’s lagging behind).

Oddly enough, I find that if I switch Handled to Unhandled in your OnMouseMove override function for your dragged widget, the lag disappears. Hope this helps someone else. :slight_smile: