Reputation: 1070
OK, it's not easy explain me so i will use an image.
I have the following problem :
Upvotes: 2
Views: 2349
Reputation: 7346
Unity has a built-in function for this : Vector3.Project
Vector3 AB = B - A ;
Vector3 AC = C - A ;
Vector3 AX = Vector3.Project(AC, AB);
Vector3 X = AX + A ; //How say Lutzl works!
Upvotes: 4