Controller Umg Rotation

So I want a UMG image to rotate to where my analog stick is facing. I’ve probably gone completely off the track but I can’t get it to fully work, this setup kind of works but not fully.

138267-60341d1468d907bd5a4151a0992b9baa.png

You can do this by using arctangent.

In your case Tan A = Y/X, so A = Atan (Y/X).

Im not sure about negative values, maybe you need to use some switch for

’ +x +y

’ -x +y

’ +x -y

’ -x -y

feed in your direction vector to a “make rot from x” node and use that rotation to drive it, (you might hafto offset the rot depending on your setup), I haven checked the documentation but I imagine it does the same thing as the previous answer suggested, only more compressed.

So, you need to simply subtract 90 from it )

So I tried what you said and it works but not completely.

Going up on the stick makes the arrow point right, pointing right makes it go up pointing down makes it go left and pointing it left makes it go down.

I subtracted 90 and it still half works up now points up and down points down but left and right are opposites.

I’ve not setup a way of detecting if it’s a minus, as well as if i did i would have to setup 1 for each minus value

Multiply on -1

There is a specific node called “make rot from x” that outputs a rotation node it would do what your need it to, (it also needs a direction vector input, so combine the x and y from your stick into a vector node, make z 0, then feed that into the “x” of make rot from x node, Im at work atm but I can make a graph for you when I get home If you need it.

UMG rotation is simple scalar, not rotator.

you can break a rotator node to get x, y and z.

this tutorial does a simple rundown of what Im talking about and implements one type of solution.

here is how it works for me

In your case you should use X and Y, not Y and Z.

This worked for me