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.
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.
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.