Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Piesk · Dec 12, 2013 at 04:35 PM · camera viewport

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Piesk · Dec 12, 2013 at 05:16 PM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

CountDown Camera problem 0 Answers

How to fix bold black bars on right side of the Game (on any device) 1 Answer

How to calculate the percentage of a mesh visible by a camera? 2 Answers

Offset the result of camera scissor rect 0 Answers

Floating Damage Text Above Object on Hit 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges