x


How do i create a minimap?

I wanted to know how to make a minimap? So i started to think maybe a second camera held directly above the character? but how would i make it appear in the top right corner of the screen. Would it be a gui or something of somesort? Please consider in helping me...

more ▼

asked Jun 26, 2010 at 06:21 AM

Brennan gravatar image

Brennan
77 42 35 39

(comments are locked)
10|3000 characters needed characters left

6 answers: sort voted first

You set the minimap camera to a higher depth than the main camera to get it to render over it.

You set the culling on the minimap cam to depth only so it doesn't render a sky box or anything to cover the rest of the screen.

You then set the viewport normal on the minimap to a corner of the screen.

http://unity3d.com/support/documentation/Components/class-Camera.html

The normalised rect is from 0-1 where 1 is the width of the screen so 0.5 would be half the screen.

You can also make the map extra special by creating a map icons layer and disabling it on the main camera and setting the map cam to only render the terrain layer and map icons layer so you'll see map icons in the minimap and not in the main view.

more ▼

answered Jun 26, 2010 at 10:42 AM

spinaljack gravatar image

spinaljack
9.8k 27 50 125

Complete and succinct - I wish more answers were like this.

Feb 12 at 12:57 AM Simon O

Thanks! This helps.

Sep 27 at 08:49 AM exorakhilas
(comments are locked)
10|3000 characters needed characters left

there are two ways to do this. 1 you can use normalized viewport as described by spinaljack in another answer. 2 you can render the camera to a render texture and use that texture in any 3d plane/GUI you want. this will require you to have unity pro.

more ▼

answered Jun 26, 2010 at 12:21 PM

Ashkan_gc gravatar image

Ashkan_gc
10.1k 77 110 165

(comments are locked)
10|3000 characters needed characters left

you make a camera, go into "game" tab (next to "scene") and set the position of the camera (i put it in the upper right corner). next, put it up REALLY high up on top of your player and set the projection to orthographic. now make a c# script that will make the camera follow your player. heres the script i used:

 using UnityEngine;

public class CameraFollow : MonoBehaviour {

     public Transform Target;
     
 void LateUpdate()
 {
     transform.position = new Vector3(Target.position.x, transform.position.y, Target.position.z);    
 }

}

then, set your player as the target. if you see any problems, reply back to me. hope it helps!

more ▼

answered May 06, 2012 at 02:44 AM

BakuJake13 gravatar image

BakuJake13
32 61 48 53

(comments are locked)
10|3000 characters needed characters left

Hi there,

Making an minimap is not as simple as it appears when you first think about it. We spent about 3 month implementing a really good working minimap/map system. Its fully customizeable, well documented and super easy to integrate. Maybe this would save you some time?

KGFMapSystem Homepage checkout the screenshots!

KGFMapSystem Assetstore

more ▼

answered Aug 15, 2012 at 11:28 AM

kolmich gravatar image

kolmich
121 7 6 7

(comments are locked)
10|3000 characters needed characters left

Set the camera depth to 1 and change the x and y until it's where you want

more ▼

answered Sep 07 at 07:13 PM

Treasureman gravatar image

Treasureman
0

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x120

asked: Jun 26, 2010 at 06:21 AM

Seen: 24704 times

Last Updated: Dec 01 at 05:55 PM