- Home /
How to set mini map camera to display entirety of the map
OK so, The aim here is this:
I have a hexagon tile grid map that is my game map. I have an orthographic camera that i want to be bound to the extents of the map, and i want to be able to set the exact measurements of the viewport of that ortho camera.
I have previously managed to do this and i thought i understood everything involved. However I recently changed how i created my map, and suddenly the size of the ortho display has gone weird. I fiddled with the code to do what i thought would fix it but it didn't.
This means that i clearly don't understand the process of setting sizes for the both the camera field of view box (don't remember the proper name at this moment) and for the "pixelrect" or the viewport box - where i thought i did.
so to re-iterate: I have a camera, and i have an object, I want the camera's left side to be displaying the left side of the object, right side of camera displaying right side of object etc.
Then i want to set the viewport to an exact box, lets say new rect(screen.width - 225, screen.height - 225, 200, 200); something like that.
Is any one able to help me? Thanks a million in advance, this problem 'caused me no end of headaches when it first came up, and having got it right once it must have been a fluke because i can't do it again.
Answer by Piesk · Dec 12, 2013 at 05:16 PM
My apologies for wasting your time, I realised that I was forgetting that orhographic size is half the height. I managed to get it working.
Answer by MFen · Dec 12, 2013 at 05:16 PM
An orthographic camera's viewing distance is not changed by its FOV like a perspective camera, it is adjusted by the size field. This may be why you are not seeing adjustments being made.
i wasn't actually manipulating fov, it's because i was being stupid and forgot that ortho size is half the height, got it fixed now.
Your answer
