How do I move my camera along its local x and y axes to look at a position?

I’m working on a tile-based strategy game, and my orthographic camera is at an angle to the field, which is flat against the y-axis.

I have two ways of moving my camera: - I can move it manually, in which case it moves along its local x and y axes. This works well because I can move it based on its current position and rotation. - I can focus on a unit. This is where I’m having issues.

When I select a unit, I’m going to move the camera to center on that unit. To do this, I’d like it to move so its centered on that unit without moving the camera on its local z-axis. (This is important to avoid clipping with the environment on large maps.) This way it will have the same behavior as when I move it manually.

I’ve included a screenshot of the editor view with the camera selected, as an example: https://i.imgur.com/Un8GZ5f.png

Does anyone have an ideas?

Thank you!

Create an empty game object that has it’s rotation zeroed out. Make your Camera a child of the newly created empty game object. Now move the empty game object, which will in turn move the camera. You should no longer have to adjust the Z to shift the camera on the X and Y no matter what angle your camera is at.