Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

Camera following/looking at aircraft

$
0
0
I have the following code so the camera follows the aircraft. Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, transform.position - transform.forward * 10f + transform.up * 2f, 5f * Time.deltaTime); Camera.main.transform.rotation = Quaternion.Lerp(Camera.main.transform.rotation, transform.rotation, 5f * Time.deltaTime); I want the camera to be slightly higher the aircraft so you don't just see the back. That's why there is an offset in the position. This is working fine, except now the camera is looking 'over' the aircraft, in stead of 'at'. How do I make sure the camera looks at the aircraft, but still follows it's rotation? Thanks

Viewing all articles
Browse latest Browse all 536

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>