How to make a Minimap in Unity

Поділитися
Вставка
  • Опубліковано 26 січ 2025

КОМЕНТАРІ • 499

  • @plagiats
    @plagiats 4 роки тому +176

    To create a map more like the thumbnail, have sprites on top of the player and each enemy, facing the minimap camera, on a layer that only that camera picks up. That way you can display an arrow where the player is and dots where the enemies are. To get animations on the minimap, animate the sprites.

  • @Tymon0000
    @Tymon0000 7 років тому +522

    Thumbnail: Awesome minimap!
    Video: Let's make a square.

    • @kenan2386
      @kenan2386 4 роки тому +19

      cmon man its so good

    • @jamesburt5385
      @jamesburt5385 4 роки тому +10

      I like brackets but let’s make a square is just funny

    • @FrostshadowStudios0310
      @FrostshadowStudios0310 4 роки тому +8

      The thumbnail one would take MILLIONS of lines of code to write.

    • @Tymon0000
      @Tymon0000 4 роки тому +16

      @@FrostshadowStudios0310 Not rly

    • @xzesstence8862
      @xzesstence8862 4 роки тому +5

      @@kenan2386 nope its not.. people want to learn how to create cool minimaps like the thumbnail...

  • @PICKERY
    @PICKERY 6 років тому +3

    I watched your videos years ago when you first got started and really enjoyed the speed, clarity and thoroughness of your tutorials back then. You're on a whole other level now, and I'm really impressed with how far you've come. Good job man.

  • @cschott
    @cschott 7 років тому +485

    nothing against using RenderTextures for a minimap, but it has certain disadvantages and does not look too good imo
    I would love to see a tutorial on how to make a minimap like the one in your thumbnail.
    With a simplified map-overview and markers for the player, enemies, loot etc.

    • @roko567
      @roko567 7 років тому +82

      Completely agree, this method is quick and easy but not really useful

    • @gannongonsiorowski734
      @gannongonsiorowski734 7 років тому +24

      Could you put an image under the map so it’s lined up and then hide the actual landscape in the camera mode? (I don’t use unity, but some people and I are debating this)

    • @cavalier4789
      @cavalier4789 7 років тому +38

      That's even easier, just make the markers and everything on the minimap UI images then take their corresponding objects' X and Z coordinates in world space and convert them to X and Y coordinates in canvas space. :)

    • @MrPiggybank1974
      @MrPiggybank1974 7 років тому +4

      I remember doing this for a 1980's game defender, "the minimap at the top of defender", I got it working but couldn't get defender game work as some of the mechanics I just could not work out in my head at the time. Like I said the minimap works fine and scales on different resolutions :).

    • @KaushalDamania
      @KaushalDamania 7 років тому +47

      Exactly! The comparing the video and the thumbnail, the thumbnail seems just for click bait.

  • @Faery69
    @Faery69 7 років тому +58

    Btw the minimap in the thumbnail is the minimap from the game Aion

  • @zacksima8333
    @zacksima8333 5 років тому +13

    To make dots appear on the map, attach 2d sprites on top of all the objects that are filtered out by the player camera and are only visible to the minimap. This way you can make enemies appear by turning on the sprites

  • @JM-dc5rn
    @JM-dc5rn 3 роки тому +8

    If you are worried about two cameras rendering too much stuff. You can have flat textures of your ground or your objects parented to the main 3D objects (like your player and items). and have the main camera not render them whilst the minimap camera does.

  • @fokeyjo
    @fokeyjo 3 місяці тому

    7 years after you created this, and it's still a really useful video! Thanks

  • @dr.araujo-junior
    @dr.araujo-junior 5 років тому +5

    Thank you SO MUCH!
    I'll definitely credit you in the acknowledgement section of my dissertation!!
    I'll also gladly recommend you to my audiences when they inquire about the game UI elements!
    You are a rockstar! Keep on doing the wonderful work!
    All the best Brazilian vibe and warmth,
    Jr. = )

  • @SuprunAlexey
    @SuprunAlexey 7 років тому +34

    Nice video!! Good job! I will try to do something same with you tomorrow!

  • @JessicaVampice
    @JessicaVampice 7 років тому +3

    Honestly have to say that your tutorials are great. I've been a subscriber for a while now and I always find your videos clear and easy to follow, so thanks!

  • @Avery_Silva
    @Avery_Silva 8 місяців тому +2

    MAKE SURE YOU DO THIS!!! Canvas --> Canvas Scaler --> UI Scale Mode --> change to "Scale with Screen Size" so if you playing on phone or tv the minimap is the same size, I do it for all the UI that goes infront of my player camera

  • @cosmingugoasa5949
    @cosmingugoasa5949 7 років тому +1

    For an IT student your content and the way you explain it, it's just fantastic.
    Love this channel, keep it up

  • @Mycrosss
    @Mycrosss 5 років тому +2

    People, he's given you the basics, you obviously wouldn't use it in a finished game without improving on it.If you want a better mini-map, you can assign an img to your gameobjects, and render that image instead of the 3D object, this would improve performance by a huge amount (and is the reason why games do it in the first place), and would get you closer to that actual ingame minimap look. Another thing I've seen people complain about is the fact that the minimap's not a circle. Just put a circle image above it and render only what's inside of it...

  • @Rambolink94
    @Rambolink94 7 років тому

    Dude! You are seriously one of the best Unity teachers around. You have already helped me so much. Thank you!

  • @Graferification
    @Graferification 7 років тому +236

    I'm sorry Brackeys but I have never played or seen a game where minimap was just the game itself but rendered from the top. Isn't it rendering everything twice? Kind of overkill. Most of the times there is a texture representation of the map with player position on top of it.

    • @pixelgames3776
      @pixelgames3776 7 років тому +24

      Filip Kaszczyński yeah. This will be a make game lag if the game is really high quality. Normally big games have a 2d picture of the map and they display it with player position on top of it.

    • @dmitrij34
      @dmitrij34 7 років тому +21

      Richard Wellman, still takes a lot more draw calls to render the frame. High CPU overhead. IT IS A BAD PRACTICE, and should be avoided.

    • @JimGiant
      @JimGiant 7 років тому +12

      What you could do is have a very simple separate object childed to everything you want on the map and set it to a minimap layer. All you need to do then is set the main camera to not render that layer and set the map camera to only render that layer. There's a dozen other ways of doing it too. This may be a really unoptimised way of doing things but it's probably the quickest.

    • @JimGiant
      @JimGiant 7 років тому +2

      Exactly. Maybe a sprite if you want something which looks a bit nicer.

    • @esckxy2422
      @esckxy2422 6 років тому +1

      Filip Kaszczyński he's not making a game from this he's showing how to put it in a game

  • @O_Mercurial
    @O_Mercurial 7 років тому +1

    Your tutorials are amazing! Each time I bump into a video of your making, I learn a lot of stuff!

  • @tengerigames2731
    @tengerigames2731 7 років тому +24

    prerendering your (static)map to an image and calculate non-static objects only instead of rendering the whole scene twice is a "bit" more performant in my opinion

    • @IIMyLittlePonyII
      @IIMyLittlePonyII 7 років тому +1

      This is exactly what I'm trying to do for my project. Sorry for being uneducated, but would you mind helping me out with some pointers on how to accomplish this? I don't want to display everything that is going on in real-time, just need to create a static image and display it since my levels will be procedurally generated.

  • @obalfaqih
    @obalfaqih 7 років тому +2

    Love your tutorials.. always clear and straight to the point.
    Thanks for the great effort :D

  • @boombaby1769
    @boombaby1769 7 років тому +1

    That was GREAT!! I'm currently not developing anything that I could use it for, but I will definetely keep it in mind when I get the opportunity! You're doing a fantastic job here!

  • @MatthewChowns
    @MatthewChowns 7 років тому +1

    Would love to see a follow up to this video showing how to apply a mask to get a round map and a filter so you can control what gets rendered, as well as replacing certain game objects with icons, and maybe even the ability to have a direction indicator on the edge of the map if an object you're tracking is outside the bounds of the minimap.

    • @pixelgames3776
      @pixelgames3776 7 років тому +1

      Matthew Chowns mask thing is easy. Direction indicators and icons instead of game objects is not possible in this method. So don't expect it. For a mask, create a circle sprite(color doesn't matter) and add mask component to raw image. Then put this circle Sprite at the mask graphic slot. That's it. You can replace circle with any other shape you want

  • @medhavimonish41
    @medhavimonish41 4 роки тому

    You are not uploading new videos but still helping us, thanks. This helped a lot in my project 😊

  • @MaZyYTube
    @MaZyYTube 5 років тому +1

    I know its old but I don't recommend this on larger projects. Your camera will render two times same scene so it means you double your vertices and tris what you see, which means at the end lower fps. You can use layers to limit it.

  • @hristaki99
    @hristaki99 7 років тому +1

    Everyone knows about the Render Textures method (and you can do the same by just changing the Viewport Rect option). I expected a map like in the thumbnail. Now that's worthy of an entire tutorial.

  • @xArchie
    @xArchie 7 років тому

    Your my hero. Without you, I wouldn't have known so many cool features on effects, coding, designing, GUI's, etc. Thank you!

  • @JayAnAm
    @JayAnAm 5 років тому

    Setting the position of the minimap should be done in the Start method of the script, then you can also the height configurable.
    The rotation of the minimap camera should not be set to the rotation of th player because in many thirdperson player games the direction of the player is not necessarily the direction of the main camera and then the minimap camera points to a wrong direction, set it to the main camera y-eulerangles instead.

  • @marty34534
    @marty34534 4 роки тому

    I'm watching this again in 2021 after watching it a few years back. I had forgotten how to do it hehe. Thanks for teaching me again good sir! :)

  • @chasebsnow
    @chasebsnow 7 років тому +6

    Just made a game using render textures.. Love your videos, thanks!

  • @SangoProductions213
    @SangoProductions213 7 років тому +4

    I watch your videos just to get the general concept behind it, even though I never use Unity.
    Basically:
    1) Get a second camera.
    2) Have the camera project/render onto an image.
    3) Display the image on the screen, as a GUI element.
    4) Do whatever touch-up details you want, such as masking or following the player.

  • @cellvsgohan1
    @cellvsgohan1 7 років тому +5

    These tutorials are super helpful. Thank you so much, Brackeys! You're my idol, man! :))

  • @magnusm4
    @magnusm4 7 років тому +1

    YOU DID SHAVE!
    I asked you to do it in one video yesterday and i'm so happy you did XD just a few straws left and it's perfect

  • @alfotube-lj3lx
    @alfotube-lj3lx 5 років тому +2

    i was watching this at night. 6:43 ... my hearth stopped for a moment

  • @monmonstartv5159
    @monmonstartv5159 7 років тому

    I keep getting all these adverts for Udemy, I don't need to pay to learn how to make games! I've got Brackeys!

  • @slonersoftgames6589
    @slonersoftgames6589 7 років тому +6

    This works, to a point, and is actually a great tutorial on render textures, but is not a great tutorial on minimaps. You should render to a texture file, and use that file, with a mapping between the texture coordinates and world coordinates. You can make it round by using a shader with a round mask over it.

  • @MichaelDowns
    @MichaelDowns 7 років тому +2

    How might I change the player looks on the minimap? say I want to replace the player character with a green dot or an enemy with a red dot?

  • @tomtomkowski7653
    @tomtomkowski7653 3 роки тому

    Worth mentioning are layers.
    You can set what layers this minimap should show, like not showing particles or any other layer you don't need on the minimap.

  • @Vyrxeus
    @Vyrxeus 2 роки тому +3

    For those who are having issues with their minimap where it does not exactly show everything from the second camera (in my case it only shows my character), do not select "No depth buffer" on the Render Texture's inspector.

  • @hakimitus
    @hakimitus 2 роки тому

    Holy moses, that was TOO EASY - I love it!

  • @DexterDLopez
    @DexterDLopez 7 років тому +2

    The video came out at a very great time! I was recently having trouble with my minimap and this definitely helped! Thanks!

  • @2TGameFootages
    @2TGameFootages 7 років тому +58

    Man... i was expecting to see how to make something like the minimap on the thumbnail

    • @Ali107
      @Ali107 7 років тому +4

      same.

    • @YorickSchouten
      @YorickSchouten 7 років тому +6

      I mean, essentially, this video teaches you most of what you need to know. You could create a similar effect by having a plane with a texture correspond with your game world, and have the minimap camera render only that. Like I said, it would work the same way, but would involve a lot of hand painting

    • @Picklespit
      @Picklespit 7 років тому

      If he showed you everything it wouldn't be a good tutorial, but he teaches the basics so you have something to start at with and eventually create something better.

    • @DustinGrahamCA
      @DustinGrahamCA 6 років тому +7

      Then, essentially, he should use the minimap he created as the thumbnail. Otherwise, show how to make the thumbnail. Otherwise it's just clickbait.

    • @squeakybunny2776
      @squeakybunny2776 6 років тому

      @@DustinGrahamCA the thumbnail just shows what is possible...
      Nothing wrong with that and nothing wrong with actually figuring out the details yourself instead of asking brakeys to "chew" everything for you...Just saying

  • @ThePerro
    @ThePerro 7 років тому

    I was just looking up how to do this the other day and you post this video. Are you God?

  • @froscity7662
    @froscity7662 7 років тому

    My minimap leaves a trail of everything behind, it's difficult to explain but when i turn as the minimap turns everything that was rendered stays on the screen as well as rendering the new positions of everything and looks a mess. When i stop the camera from rotation whenever my player moves the model leaves a trail behind it?

    • @froscity7662
      @froscity7662 7 років тому

      Never mind I fixed it! If anyone else is having this problem make sure your minimap camera's 'Clear Flags' setting is NOT switched to 'Depth Only' or 'Don't Clear'

  • @TheNatebrycChannel
    @TheNatebrycChannel 7 років тому

    Loved this video, didn't realize how simple a minimap could be... I'd like to see a video on replacing objects on the map with symbols, and making the map itself a graphic!

  • @TheLoveBomberz
    @TheLoveBomberz 7 років тому

    This is the ONLY good minimap tutorial for unity

  • @marcoottina654
    @marcoottina654 7 років тому

    Nice explanation, short as needed, efficient, tuned.

  • @zafranullah8328
    @zafranullah8328 7 років тому +1

    sometimes when player goes to the edge of map, it shows that the map ends (like at 6:26). Is there any way to remove it, like place some restriction?

  • @ziyingwangTranslations
    @ziyingwangTranslations 7 років тому

    Yes! A short video of how to make a mini map

  • @wisewind5643
    @wisewind5643 7 років тому

    Awesomeness, I got to know about this video because of my notification is on but i was so excited about this video that i wanted to find a way to on notification all over again.

  • @MrBucket77
    @MrBucket77 3 роки тому +1

    Sure, sure a Minimap is fantastic for a Game!🤩
    Thank you for the Idea! 👍

  • @ssmssharma
    @ssmssharma 7 років тому

    I think you can make it look a whole damn bunch good ..
    .
    .
    Looking forward to see that in part 2 of this video

  • @t3hJonas
    @t3hJonas 5 років тому +3

    ZOOM:
    - Add buttons in project settings (edit > project settings > input manager) named "Zoom Out" and "Zoom In".
    - Add the following script to e.g. EventManager.
    - Add your minimap camera and values for min and max zoom to the script.
    - Advantage is, that this is no transform, but the actual ortographic size, which was mentioned in the video.
    public class zoom : MonoBehaviour
    {
    public Camera camMini;
    public float min, max;
    void Update()
    {
    if (Input.GetButton("Zoom Out"))
    {
    if (camMini.orthographicSize = min)
    {
    camMini.orthographicSize = camMini.orthographicSize - 10;
    }
    }
    }
    }

  • @cool_gamertag4488
    @cool_gamertag4488 2 роки тому

    I cant say how much i am thankful for you seriously your amazing

  • @bigjiggly7490
    @bigjiggly7490 7 років тому

    The old Brackeys is back : o

  • @williamzhu4901
    @williamzhu4901 4 роки тому +2

    R.I.P Brackeys!!!!!. Trying to get this message across all his videos. Hope you come back to youtube. R.I.P

  • @matthewceneeclatt3729
    @matthewceneeclatt3729 6 років тому

    Wow, this was much easier than I thought it was. Great video!

  • @mikhail_simin
    @mikhail_simin 2 місяці тому

    If you're changing perspective to Orthographic what does it matter how high (Y) the camera is?

  • @arturitoproductions
    @arturitoproductions 3 роки тому

    Your videos are still the best reference :)

  • @jonathanl123
    @jonathanl123 6 років тому +24

    Love your videos. "Euler" is pronounced "oiler" by the way

    • @lastidea4925
      @lastidea4925 5 років тому +3

      Thanks for information :) I was pronounce "yuler" , till I read your comment

    • @babissof
      @babissof 4 роки тому +1

      Finally someone said it :)

  • @blitzkreg335
    @blitzkreg335 7 років тому

    Whoa man ! Your tuts are really well done !! :D

  • @treytose3
    @treytose3 7 років тому

    Love the Unity videos! Keep it up!

  • @ivavoy2800
    @ivavoy2800 6 років тому

    I have a problem I can't solve. I use a flycam to move freely on a vast terrain. Then I use this method to create the Minimap, but then I need a "dot" or some visual cue to know where the camera is in relation with the map. I've tried several things with no success. Any ideas or code to show a dot in the position of the flycam??

  • @Aversion666
    @Aversion666 6 років тому

    Did you think you were ever gunna say the word minimap this much in a video?😂
    thanks though, awesome tutorial. i love it.

  • @Hadermite
    @Hadermite 7 років тому +59

    Can I disable the ugly shadows on the minimap?

    • @DANLi_
      @DANLi_ 7 років тому +40

      Hadermite disable shadows on minimap camera

    • @ilovecokeslurpees
      @ilovecokeslurpees 7 років тому

      How do you do that? Newb here with Unity.

    • @Bossasin
      @Bossasin 7 років тому +13

      Attach this script to your camera:
      using UnityEngine;
      using System.Collections;
      public class ScriptName : MonoBehaviour {
      private float previousShadowDistance;
      void OnPreRender () {
      previousShadowDistance = QualitySettings.shadowDistance;
      QualitySettings.shadowDistance = 0;
      }
      void OnPostRender(){
      QualitySettings.shadowDistance = previousShadowDistance;
      }
      }

    • @neotomatoe7257
      @neotomatoe7257 4 роки тому

      Yes

  • @kingreinhold9905
    @kingreinhold9905 7 років тому

    Thank youuu! :D Please never stop making tutorials

  • @bhartisharma139
    @bhartisharma139 3 роки тому

    Can I just add a rigidbody to the minimap and disable rotation? Will this work so I don't have to make the script

  • @austinheydari1813
    @austinheydari1813 7 років тому

    Thanks for all the videos :) keep up the good work ! Learned a lot of stuff

  • @yaboimrfailure2226
    @yaboimrfailure2226 7 років тому

    Is there any website that has a list of these codes and explains what does what? i can barely understand these and i even have finished a programming course twice

  • @s4mcreed314
    @s4mcreed314 7 років тому

    WHOA! U SHAVED! LOOKING AWESOME

  • @dinkinflicka157
    @dinkinflicka157 2 роки тому

    Thank you so much! I just got into Unity and this is super helpful!

  • @jcrc1717
    @jcrc1717 4 роки тому

    Why mini map z rotation is changing when player look around? Wasn't supposed to be always 0 on the script?

  • @kylopootis6489
    @kylopootis6489 7 років тому +6

    sir I haven't seen any teacher like you,
    you are best I like your every videos
    and thanks for these amazing videos.

  • @nationwide9102
    @nationwide9102 6 років тому

    Quick question: If I wanted to make a 2D game, couldnt I design really top notch quality art in a 3D environment and make the CAMERA as the minimap one is instead of 1st person? What would the drawbacks be to do this other than time making 3D art compared to time making a 2D sprite.
    I think it would be very interesting and later down the road make for some fun 2D to 3D type interactions. "Hey you know that 2D game model you've been playing the whole time, well now lets fight a boss in 3D" It would blow peoples minds.

  • @aspiron9438
    @aspiron9438 6 років тому

    Is it only a Unity Pro feature? If so is there another way of doing a minimap in non Unity Pro?

  • @0001amitkumar
    @0001amitkumar 7 років тому

    It's is really very helpful. I created a minimap as you described in video, but It doesn't show objects lying beyond the minimap camera view, how to track them as well and show their markers around the border of the minimap. Can you please help me regarding the same. Thank you very much in advance.

  • @denkozlov4220
    @denkozlov4220 6 років тому

    I didn't get what was the point of the script if it works pretty much nice without it??? Thanks!

  • @guilleacq
    @guilleacq 7 років тому +1

    Nice video (as always)
    Butt could you please make a tutorial on gun recoil? I just can't make it work

    • @ilmacs8827
      @ilmacs8827 5 років тому

      If you still haven't found a solution, I'd suggest you to use rb.AddForce

  • @nextcent
    @nextcent 4 роки тому

    That's amazing! That's exactly what I was looking for. Thank you.

  • @tt128556
    @tt128556 3 роки тому

    Followed every step, but my map is only showing a still of the water element I have in my project. No terrains or anything are visible :( I've also noticed that many other tutorials are difficult to follow due to Unity version upgrades removing or relocating some components.

  • @andremendes3164
    @andremendes3164 6 років тому

    Can we put a light for where we are looking at in minimap like Counter Strike minimap?

  • @haseebkhokher4738
    @haseebkhokher4738 6 років тому

    How to make objects stick to edges of minimap when they are not in minimap boundaries range?

  • @jesse143_
    @jesse143_ 4 роки тому

    Is it possible to use a image instead of a top down view thing?

  • @lucio4578
    @lucio4578 6 років тому

    This man is a legend

  • @TheOriginalDeaf
    @TheOriginalDeaf 4 роки тому +1

    I know you left the channel but...in this video you didn't put public float when you put Vector3 and it worked with you but it didn't work with me...how can I fix it?

    • @TheOriginalDeaf
      @TheOriginalDeaf 3 роки тому

      ok I figured it out...but that was a long time ago so I lost it, so I cant help anybody with that.

  • @nihaanali7719
    @nihaanali7719 5 років тому +1

    You Save my life bro!! Let's have some drink 🍷🍷

  • @IzeIzeBaby
    @IzeIzeBaby 7 років тому

    What about a metroid style map where the rooms get added as you discover them? Just set the cam to specific layers and then push the object to that layer or is there a better way?

  • @teratocarcinoma3142
    @teratocarcinoma3142 2 роки тому

    I don't know why when putting the texture in the camera it is no longer rendered in the main camera.. i cant follow the next step

  • @mohdmusheerkhan7012
    @mohdmusheerkhan7012 6 років тому

    Awesome video, but i just want to ask you there are two camera one is for main game play and one for map, then Unity engine have to do double work?

  • @nnslife
    @nnslife 6 років тому +1

    Instead of creating your own Follow-Player script you can now use CineMachine which has that functionality.

  • @cThePush
    @cThePush 7 років тому

    is it better to create using coordinates with only script?

  • @a-gaming7261
    @a-gaming7261 4 роки тому +5

    I mean .. we miss brackeys a lot ... BUT HOW THE HECK DO I MAKE A MINIMAP WHILE IT'S SHOWING ONLY GREY WHEN SETTING THE MINIMAP RENDER TEXTURE DEPTH BUFFER TO NO DEPTH?????????

  • @andrewlees3946
    @andrewlees3946 7 років тому

    how would I add markers on top of certain objects?

  • @Explosion1000
    @Explosion1000 4 роки тому +1

    it only shows the skybox on the render texture

  • @IndieMarkus
    @IndieMarkus 7 років тому

    Didn't you already do this with the tanks?

  • @rescuetoasts6388
    @rescuetoasts6388 7 років тому

    how did u make the code different colour like for =+* the colour was red and for MonoBehaviour it was orange. plz help I think yours looks better than default

    • @adarshupadhyay5410
      @adarshupadhyay5410 7 років тому

      GiraffeStrafe he is using Visual Studio and not monodevelop

  • @wallakfir90
    @wallakfir90 7 років тому +2

    Hey Brackeys, do you have any plans to do 3D level design tutorial at some point in the future?
    Thanks.

  • @alientizim
    @alientizim 3 роки тому

    Thank you!!! This is awesomeness!!!

  • @nurulfikri2967
    @nurulfikri2967 7 років тому

    I know its already late but can you make the minimap shown only when i pressed keyboard 'M' word, and it's not minimap tho, morelike map that covering the entire screen like in some MMORPG. game

  • @001Camera
    @001Camera 3 роки тому

    What if want to add a little dot onto the player? How do I do that?

  • @akkirverma
    @akkirverma 4 роки тому

    You are Awesome Brackeys👍❤️😘😘

  • @JiosX
    @JiosX 4 роки тому

    How do I substitute a gameObject with an icon in the minimap? For example when a power-up appears and then it will show a flickering 2d sprite of the power-up in the minimap?