- Home /
How to make a camera "point" at an object.
I need to turn the camera towards an object (or NPC) when the Player collides with a TriggerCollider but the player can apporach the TC from diffrenet angles. My question is : How can I make my camera "point" at an ojbect regardless of its position and angle?
Transform objectNPC;
Camera.$$anonymous$$ain.transform.LookAt( objectNPC );
Something like this maybe..
Camera.main.transform.LookAt(lookTargetTransform);
Thank you very much! I'm fairly new to unity. Had no idea it would be this simple. Thanks!
Answer by NikoBusiness · Jan 06, 2014 at 10:32 AM
Use transform.LookAt(target);
(im answering with answer not with comment)
Excuse me, how or where put code, if I use only the GUI for modeling?
Your answer
Follow this Question
Related Questions
Create camera transition from one point to top of object 1 Answer
Make object appear within camera view 0 Answers
camera acting weird... 1 Answer
2D Aiming in a 3D game 0 Answers