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
0
Question by oliver-jones · Jun 20, 2012 at 01:56 PM · positionmapvectormaskmini

Vector Based - Mini Map

Hello,

I've been looking around the Unit forum for advice on a Mini Map for my game. But I mainly come across the same advice, which is to add a second camera to your scene, mask some renderers and reposition the view.

But thats not really what I am looking for. I want something more vector based, so a drawing of my entire map (done on a large canvas in Photoshop), that either:

  • Has an arrow in the centre of it, thats always pointing upwards (the arrow is the players direction), and the vector map rotates around the player according to the direction of the player, and moves in the direction too.

  • OR, the arrow rotates according to the players position (instead of the map rotating around us), and again, the map moves in the direction according to the player. (I prefer this idea)

Now, like I said, the map is just a vector based drawing in Photoshop, thats imported as an image thats going to be drawn on the OnGUI, right?

And the image (texture) coordinates moves according to some kind of formula that takes into account my players position. First off, I have no idea what that formula would be, and also, I would like my Mini Map to be in position top right of my game window... The problem I'm getting straight away, is that my entire map canvas is being drawn over my game, and not just a little square (top right), how would I mask a square looking mini map?

Thanks!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Tim-Michels · Jun 20, 2012 at 02:27 PM

I would suggest the following:

  • Make a seperate (isometric) camera for the minimap.

  • Setup a custom normalized viewport rect, to make the minimap camera as a part of your view.

  • Place your large canvas texture on a plane, high above your world.

  • Make sure your canvas matches the world scale. (check with isometric top view)

  • Add code for your camera to set it's x and y position equal to your character

This is a pretty simple way of doing this, don't know if it matches your needs. Hope it helps.

Greets

Comment
Add comment · Show 2 · 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 oliver-jones · Jun 24, 2012 at 10:49 AM 0
Share

Thanks tim, how would I prevent the entire map canvas from showing on my plane? As I move in the game, I want the plane/map to move too (the map is zoomed in)

avatar image Tim-Michels · Jun 27, 2012 at 10:21 AM 0
Share

You setup your isometric camera to take up only a part of your screen. Experiment with its normalized viewport rect to make it only a part of the screen. That way, your map that is rendered by the isometric camera will only be shown inside your custom view rect.

edit You can also change the "size" parameter of your isometric camera to alter the "zoom".

Hope this helps.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How would I rotate a position vector to get a new position vector. 1 Answer

Assigning UV Map to model at runtime 0 Answers

How to make cubes between 2 point and stick them together? 0 Answers

Two Firing points, Vectors 1 Answer

move to a position not being looked at 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