Hi there. So I have a top down game and I’m trying to make some sort of system that will display arrows in your UI that will point in the direction your allies or your objective are in, so you can head in that direction.
I have no idea where to start with this however.
I would like to either just have them rotate in the direction that the objective is in, your move around the peripheral of the window/screen to aim you in the direction you should head.
Hey there, this will give you the angle between the direction the character is facing and the objective. If you plug this angle into the arrow’s rotation in UMG (the arrow by default needs to be pointing up) it should work.
I’d like to have the arrow be able to move around the peripheral of the UI, but a fixed one could work as well, and I’d just work from there for achieving the result I want, just not sure where to start.
If you are referring to having an arrow that can go into the corners of the UI based on the target’s position when it’s out of view, then you can project that world space location into screen space and then clamp the result to be within your screen limits.