Determining and comparing actor locations

For starters, I hope I am posting this in the correct spot and thank you in advance for any help I may receive.

This is something that has bugged me for a while, I find myself revisiting this subject every once and a while and give up because I can’t find the answer.

What I would like to do, is have 2D sprites in a 3D world (like old shooting games such as Doom).

If I’m facing another actor in the game, I would like to see the sprite facing me like this:

If I move behind the actor and providing that actor stays still, it should change its image or sprite to be like this:

Thanks again for any help

  • Levi