There is a tank on the ground. But my camera is under the ground. I want to move camera to ground and do not change the direction between tank and camera. So i need the position of this place. I kown the funciton named “Trace” of UDK can do this. How to get it in unity3d?
No,like this photo.[10378-qq截图20130424140443.png|10378] The positions of object A and Camera B are known, how to get C point position?
– windskyraycast. -_- Ray ray = new Ray(); ray.origin = A; ray.direction = B - A; RaycastHit hit = new RaycastHit(); if ( Physics.Raycast(ray, out hit) ) { C = hit.point; } You might need to use "Layer Masks" to make the ray only be able to hit the ground.
– LoiusMy problem is solved.Thank you.
– windsky