You’re asking “Where along the line of the Y axis of my object does it intersect the XY plane of its parent?”. The google term is “Line Plane Intersection”
There’s a couple main ideas to make this possible:
-
If you make a line that’s perpendicular to the plane, then any other line that’s perpendicular to that line MUST be exactly on the plane.
-
The dot product of 2 vectors is 0 if and only if they’re perpendicular
-
If you have a point and a direction vector, that point plus some random multiple of the direction gives you a new point on a line.
Using those 3 ideas together: If we move some multiple of a direction from our starting point, and dot that with the normal, and it equals 0, then we’re on the plane.
Using that we can make an equation, which we can directly solve for that “some multiple”, which you can add to the Y translation to get to the plane.
I don’t have time today to give you a FULL writeup … so I just googled it and found a Stack Overflow answer that seems worth trying
3D Line-Plane Intersection - Stack Overflow
And just a little optimization you can do: the vector u
in the SO answer is equal to the second row of the matrix of your object divided by the Y scale value.