Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

put camera in var?

$
0
0
Hi guys,

I'm newish to unity and i really cant figgure out how to put my "Main Camera" in a variable:

Code (csharp):
  1.  
  2. #pragmastrict
  3. var target:Transform; //I really want to just hard code the camera name here so it gets passed to transform.LookAt(target) below
  4.  
  5. functionStart(){
  6.  
  7.  
  8.  
  9. }
  10. functionUpdate () {
  11. transform.LookAt(target);
  12. }
  13.  
Any help would be great

Thanks

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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