Make a UI element track a GameObject

I need some help making a UI sprite (an arrow) to point where a gameocject is. I just need it to move along the top of the screen, the Y axis doesn’t matter.

would a text mesh work better here for you? Create at given point, track by matching the axis you wish to follow.