- Home /
How to point a camera at a point in front of player.
Im trying to create a camera that points just in front of the player but i find the correct position to point it at.
Im trying to do it like this
in the LateUpdate()
transform.LookAt(player.transform.forward+(Vector3.forward*10));
This seems to make the camera look in front of the object at first but when my object turns does not face the front of the object but keeps facing in the same direction.
Answer by robertbu · Apr 19, 2014 at 03:03 PM
Try this:
transform.LookAt(player.transform.position+player.transform.forward*10);
transform.forward is referencing a local vector that always will be aligned with the objects orientation, and Vector3.forward is the global vector that is aligned with the world and will always be (0,0,1).
if that makes u any smarter @Panboy :)
Well I think that did the trick, Honestly I thought id tried something like this already. Thanks for the reply.
Your answer
Follow this Question
Related Questions
Camera Follow a Target, but not Centered on it 1 Answer
Camera View Problem 0 Answers
Camera follow the player code 0 Answers
Camera Follow works partially, need help to finish the script 3 Answers
I'm clueless about how to make my script change its position based on how close it is to the wall.. 0 Answers