Geometry problem

Hi! I am trying to make some IA for my game and I need it to aim to the human players.
The problem comes when I try to get the vector that stores the aim direction. So far I use a Plane and Raycast so that the plane is centered and oriented by the “enemy” transform and use Raycast to project the player position in the plane. What I need is a way to get a reference system (x and y axis) centered on the “enemy” transform and find the vector that connects the “enemy” transform and the player projection INSIDE the plane (it should be a 2d vector like (x0, y0))…

Here is an image to show the problem:

ty for your time.

Is this a 2d game? (providing a 3d picture doesnt make what youre asking any clearer when you talk about x/y)

its a 3d game but the calculation is made in 2d. A 2D solution will work

I dont get what you are trying to do.