2D Dynamic Camera Offset

Hi everyone,

I’m currently taking my first steps in UE4 2D development and I’m trying to constrain the camera to not go over a certain z position in world space.

I’ve tiles and everything setup and working. My tilemap is 0.0.0, it’s 1024px high. My camera offset on the character blueprint is zero (centered). Camera Orto width is 1280. Editor play size is 1280x720.

I tried to adjust the camera boom offset in the character controller blueprint but I don’t know how to get the correct value for the offset. Getting the camera world position and substracting it from the view port height doesn’t give the correct value. I’m actually not sure why that is the case.

Any pointers greatly appreciated! Thanks in advance!

Are you trying to zoom in and out with an orthographic camera?
If you are trying to do the equivalent of zooming with an orthographic camera, you can do so by changing the Ortho Width.

By definition, orthographic projections ignore distance, unlike perspective.