Adjusting camera z-target

I'm trying to pitch the camera down and zoom inwards on a unit in order to get a "close-up" feel. It works fine at low elevations:

enter image description here

But at high elevations, this happens:

enter image description here

I think what is happening is that the z coordinate of the camera's focal point is still at 0 on the z-axis even though the unit is higher than that. Is there any way to make the camera respect elevation or at least adjust that z coordinate manually?

Comments

  • Posts: 203

    Can't you get the current pitch and then work from there ?

  • Right, I'm setting the pitch, the problem is that the pitch seems to be relative to a fixed position on the z-axis that I'm not able to set.

  • Posts: 203

    Get the unit Z position and use it to modify your camera offset with SetCameraLookAtPositionHeightOffset maybe ?

  • Oh this works well. Somehow it didn't occur to me what that function was. Thanks!