Raycast visual and moving text possition.

Hello Unity community,

We’re a group of students finishing some volunteer assignment, about creating visual representations to younger math students. Currently we’re creating an interactive mini game-program that at the end, will allow the user to navigate a point around in a 3 dimensional space, to understand certain things like Dist(p) formula, and geometric space easier. But we need some help!

The setup:
We’re using three planes, to represent the background of the geometric planes, and a point object inside the perimiter, I’d like to use something like raycast for:

(a) Project a visual line from the point in three directions, towards the planes.

(b) Extract the x,y,z coordinates from the point, and display at the point where the raycast collides with the plane, and move this point around as the point in space moves around.

Any help is greatly appreciated, and all coding contributions will be credited in the index of the entire teaching material.

You will need to use LineRenderer to draw your lines. It is probably not necessary to use a RayCast as you will know the distance from your point to your 3 planes so any calculation of your text position or lines will be taking the coordinate of the point and just replacing a dimension with the position of the respective plane.

To convert your plane coordinates in 3D to 2D positions for an OnGUI call to draw your text (for example) - you would use Camera.WorldToScreenPoint on Camera.main (the currently active camera). This will give you the pixel location of your impact points.