Hi everyone. I'm Jeremy Gibson Bond and welcome back to the Unity Certified Programmer exam preparation course. In this video, we're going to be looking at your next challenge which we're calling the MiniMap challenge. What you're going to be doing here is creating a MiniMap in the top-left corner of the screen that follows the character and enemies, and shows various aspects of the game. Let's take a look at the finished version in Unity. So, here we are in Unity. Let's take a look. You can see the MiniMap up in the top left corner and I'm going to go ahead and maximize on play and hit Play, and then zoom it up a little bit so it's easier for you to see. All right. So, here's my character. You can see that on the MiniMap, my character shows up cyan. The enemy is patrolling in orange and you can see that the searchlight here, the light cones on both the enemy and the security camera do show up. Now, one thing I want to be sure to point out here is as the enemy character gets over to the edge, see how the light cone does not extend beyond the edge, it gets stopped by the edge. That is a small part, but an important part of this challenge. So, let's dive in and look at some aspects of how I want you to implement this. The first is there's this MiniMap empty game object that serves as a parent for everything having to do with the MiniMap. Underneath it is the MiniMap.Camera which is the only object that is there at the beginning of the scene before seen actually starts. The MiniMap.Camera has an orthographic camera and it has some of the layers selected, but not all of them. So, it's only showing some layers. Then there's the MiniMap.Camera script and what this does is you can see it has two layers selected, cover and ground. It zooms and centers itself to surround everything in cover and ground and then add a 10 percent border around the edge there. You can see an approximation of that the way it is now, but when I run it, you see it actually really cleanly aligns and if I were to make the level bigger, it would automatically scale and align to the level. Cam size here allows you to override that, but currently, I've not set this up to actually follow the player if the cam size is set to anything other than zero. So, right now cam size is set to zero and you can see that if I mouse over it, it talks about this. If it had something larger, it would not autoscale itself. But again, right now it would not follow the player. You'd have to add a script to make it follow the player. The MiniMap manager down here is where a lot of the magic happens, and you see that all it has in there are two instances of a struct and the struct captures three things. One is the tag to look for, currently we have player and enemy, the second is the color that we want the blip following the game object with that tag to be, and the third is the prefab for that blip. You can see I've created a sphere and a cube MiniMap blip prefab in the prefabs folder and this is actually in the starter project for you already. When the MiniMap manager starts, it tells itself to assign blips to any game object with the tag player or enemy, pulling those tags from the tags to track array. So, you can see that the player has the player tag and the enemy has the enemy tag. The MiniMap manager will then instantiate a blip for each one of those, color that blip to be the right color for the type that it is. It also keeps track of those blips. So, that later, say when we change a level, it can destroy the existing blips and instantiate new ones and that's really important. As it does so, it makes sure to place all of those blips underneath the same MiniMap. Parents transform here just to keep them neatly aligned in Hierarchy view, which just keeps things organized for us which makes it a lot nicer for other people to work with. Of course, there's also the MiniMap blip script that follows the transform it has been assigned to hovering above it at about five meters above it. Then the last thing, is this EnemyLightConeBlocker, which sits at the end of the hallway and stops that light cone from splashing out of the hallway off into the distance because that looks terrible in the MiniMap. Also, be aware that there are certain things like the blips that should be in the MiniMap physics layer and those things should not appear in the main camera. So now, let's take a look at what I'm giving you in the challenge project. You can see here that I've given you the MiniMap parent game object, and I've placed a MiniMap.Camera beneath this. I went ahead and did this. So, I could set the Viewport Rect and orthographic. It just kind of get everything set up with the camera information, so that you only really had to worry about the scripting on the camera. Then I've also given you over in the prefabs folder, the MiniMap blips for cubes and spheres and the MiniMap.Camera. If you look at the cube or a sphere, you can see it's got this custom unlit, overlay, shader, that just is bright and unlit and always shows up really obviously in things like the MiniMap. Also, in the scripts folder, there is a MiniMap folder with the MiniMap scripts into. That was just to keep things organized like the player interaction thing from last time. All right. So, that's it for this challenge. Now, as you're doing this, we're not yet changing levels or having multiple levels, but I want you to just keep in mind that we're going to in the future as you are working on this and try and design it with that in mind. So, have fun with this challenge and I will see you in the next video. Take care.