Hi im trying to figure out a way to get the vector 3 of an intersection.

If i drew a line along game object B’s Z axis until it reaches game object A’a Z depth i want to get the position of the point where they meet.

B could be facing A directly or looking diagonally to the right or left of it. Basically i don’t care about the direct relation of B and A but rather where to the right or left B is looking along the X axis of A.

I need the info as data for the movetowards method

I thought i might be able to use a ray, but not sure how i could make the ray shoot the exact distance to reach A’s Z value and get that point. I cannot calculate the distance between A and B since the line could be diagonal.

Hope its not to confusing. Appreciate any help !

Cheers.

Edit: Added an illustration to the problem.