lookAt

Sorry for this (maybe) simple question, but I can’t find any answer in the manual and the API reference is rather cryptic. I have my camera following my main character but the lookAt function orients the camera to the center of my character, displaying a lot of ground. Is there a simple way to tell the camera: look at my character, but slightly higher ? I tried and played with the camera setHpr without any good result.
Thanks in advance.

Sure. Try:


camera.lookAt(myCharacter, 0, 0, 5)

David

Thank you (once again). That is exactly what I needed. however I have to use 1 rather than 5. What are the units ? Certainly not degrees. Does that meen “tell the camera to look at my character’s position plus 0 distance units in x, 0 in y and 1 in z” ?

Yes, the units are distance units. It means “look at point 0, 0, 1 in the coordinate space of myCharacter,” which is the same thing as saying, “tell the camera to look at my character’s position plus 0 distance units in x, 0 in y and 1 in z.”

David