I have created a helicopter over terrain (say at y=50). I have a terrain that is 500x 500. I would like the helicopter to orbit with a radius of 50 (available for change above the point in a variable). I would like to have a speed variable that I can set set based on how it looks.
I need it to orbit at the same altitude in a circle in the center of the map (250,0,250), with the helicopter rotating to always face forward on the flight path.
I have some orbiting code here that makes the helicopter go in a circle, but I do not know how to face the helicopter forward along the flight path. I am not fully happy with the code, as when I tweak settings it also seems to make the circle elongate and have strange behaviour based on various combinations of speed, angle rotation, and radius. Additionally, this code does not orbit around the point but in a circle to the north of it (along the z axis forward). Please recommend some easier code or tweaks!!!! Thank you!!
In Unity there are a number of simpler ways to accomplish the same task. Attach the following script to your helicopter. Set the pivot to the position in the air around which you want your helicopter to rotate. Place your helicopter at one position on the circle out from the pivot.
answered Mar 22 '13 at 05:53 PM