How to make arrow pointing to enemy?

i want to make an arrow that points to a moving shape.

i have a flat plane with a first person controller and a cube shape on it that moves.

How can i make an indicator of some kind (2d or 3d if possible) that allways points to the cube? i guess it is kinda like a compass, but always pointing to the cube.

Like on airplane games where there is an arrow pointing to targetted enemy, or in COD where it shows the direction of the last enemy to shoot at you…

Make sure your arrow points along the +Z axis (=blue axis). Then you can use Transform.Lookat() to make it point towards a Vector3 position, or another object.