How to find coordinate

Hello guys,

I need a solution but i really dont know how to explain. I drew what i want to ask. So, I need the coordinate on question mark. And i need it in 3d. How can i calculate that coortinate Vector3?

If you have issues with these kind of questions i can only recommend to try solving some basic trigonometry and linear algebra math questions. This will help you get an understanding for this.

Either way:

you first want to get the vector A which connects P1 and P2 which is A = P1 - P2

Then you want to set the length of this vector to one. This process is called normalization where you divide all entries of a vector by it’s total length. In unity you can do var A_normalized = A1.normalized;

Now the point you are looking for is

 var target = P1 + A_normalized*L;

Or if you want to do that in one line:

 var target = P1 + (P1 - P2).normalized * L;

Please try to understand what is happening here and do not blindly copy the code.