How to attach widget to mouse?

Hi, how to make an element move along with the mouse along the X axis?

I have tried this:

But the result does not please me.

Element moves diagonally up and down

The parameter Translation is Vector2D, and conversion from float to Vector2D is ambiguous. Looks like that by default all the axis are set to that float, which is leads to diagonal movement.

Either use β€œmake vector2d” node:
ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

Or RMB on pin β†’ Split struct pin:
ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

2 Likes

Yes, it works. Thanks! But there is one more problem, the mouse and the element are far from each other.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.