- Home /
Making objects look further away in ortho cam
I am using an ortho camera for a 2D game I am making and I want my objects to scale properly since I can't use my Z-axis (AKA what is further away look smaller then what is closer). How should I do that? I'm getting my initial object position in relation to my camera since Im pretty sure Im going to use that data but I dont know where to go from there =/ HALP
You say you can't use the Z axis but never explained why not? Why can you not use a perspective projection from the camera and Unity will take care of depth perspective.
Yes, it sounds like you're making things unnecessarily complicated. Just use a perspective camera. You're not forced to use an orthographic camera just because you're doing a 2D game. (For example, Zombieville USA uses a perspective camera in order to do parallax scrolling in a 2D game in a simple way, by just letting Unity handle it.)
Answer by robocognito · Apr 06, 2012 at 06:28 AM
You want to use an orthographic camera to keep things perpendicular to the screen, but still want items in the distance to scale down, there's a pretty obvious solution: Scale the objects in question.
Start by creating a script to scale the distant objects based on their distance from the camera. I'm not much of a coder, but that's where I'd begin.
I'm having the same problem. The prob with using perspective is if you have the camera stop following (like when the character reaches the edge of the map) then when you move the character up/down, it moves diagonally to the viewer. Whenever the character isn't centered on the screen, pushing up will make them move diagonally.