How To Make A Mini Map In Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this tutorial i'm going to go over how to create a mini map instead of unreal engine like the one being shown on the video the mini map will accurately display where our player is and will also show the player's rotation on the minimap to get started we first want to create a mini map and to do that we can go to the place actors tab and look for scene capture 2d and we just want to drag this into arnold engine somewhere onto our map and what we're going to do is under the rotation of this in the y-axis we just want to make this -90 and what we're going to do is we're going to use the scene capture 2d to create a map of the current level that we're in so in order to set that up we're going to do is just right click and create a new folder and just call this mini map and then we're going to head inside here and just right click again and select materials and textures and we want to select canvas render target and we just want to call this our mini map target and we just with our um scene capture 2d selected we just want to drag this minimap target and drag this into here and as you can see if i just move this up a bit it will create an image of whatever our camera sees in order to make this capture more of our um game what we want to first do is change the projection type to orthographic this will just make it so that everything appears flat and then to make it zoom out we just want to increase the author width so the higher this number is the more zoomed out will be so i'm going to make this 4000 and we can see it's quite zoomed out and if i make this a hundred it'll be quite zoomed in so we just want to make this the value like 4000 so it's quite and then finally for our scene capture 2d in the location we want it to be um zero in the x and zero in the y it's fine if these values aren't zero but in this tutorial i'm first going to go over the process of creating the menu map when these values are zero and then i'll go over the process of from creating the minimap when these values are moved a bit then once we've done this we can just right click on this image go to asset actions and go and we just want to save our mini map to somewhere on our computer then you want to open photoshop um if you don't have photoshop you can use or photopia you just want to import the um image that we just exported so you can find it go to open and i'm just going to open up my image the image will be a hdr file i'm going to open up into a photo application somewhere and here would be where you would edit the image if you wanted to so you could just design the mini map you could like paint over it if you wanted to do that but for now i'm just going to um leave my mini map although here's where you'd like paint and design the media if you want to do that so once you've done your editing all you want to do is just go file and go save as and then we want to save this as a tiff and go save and we can select 16 24 32 either it's fine and just save this back to our desktop then once you've done this you just want to import this image back into your unreal engine okay so i just need to make sure that i've named it something different because it's completing actually we can delete this as we don't need it anymore and we just want to import the image of the mini map and whilst we're here we also want to import this player icon so this is going to be the icon which represents our player when we display our mini map you can use your own icon but i'll also leave a link in the description where you can download and use this one so we just want to drag this into our folder and right click on this and go sprite actions and apply paper to detach settings just to make it so that the image imports correctly and with that we're ready to start setting up our new map so the first thing we're going to do is create our player icon for our mini map so the thing which will display where our player is in our minimum so do that just right click look for use interface as like widget blueprint and then just call this um player icon underscore widget blueprint and then we just want to head inside here and then what we want to do just double click and open this up and then we just want to select this canvas panel and delete it and instead in the palette we just want to overlay and just drag this into the player icon which is different and then we want to look for an image and just drag this into the overlay and we just want to select this image and we want to align this into the center so click horizontally align center and vertically align center this will just put the image in the middle of the screen and then for the image we want to go to brush and we just want to change it so that is our player icon so just look for the player icon image and select it and it's a bit big so we can just um change the size of this in the image size so i'm going to change this to be 100 by 100 actually we'll take it to be 50 by 50. and this will be the size of the icon on our minimap and then what we're going to do is head over to the graph and make it so that when our player basically rotates we also want this icon to rotate with our player so that way on the main map it shows the player's rotation so in order to change this effect all we're going to do is just drag in our image look for get image and then drag up here and look for set render transform angle so set render transform angle this one we want to hook this up to event tick and in order to make it face the correct rotation we want to right click don't forget player character and then from here we want to drag a player into a gap mesh select this one and then from here we're going to drag here and forget world rotation and then we want to right click here and look for split track spin and just hook up the z and then go compile so now we basically set up the player icon which we're going to put on top of our mini map so with this we're ready to start our mini map and to do that we just right click again and a user interface select widget blueprint and let's call this mini map underscore widget blueprint and head inside here the first thing we want to do inside here is go to our palette and look for an overlay and just drag this inside the canvas panel and then we also want to look for an image and we just want to drag this image inside of the overlay then we want to select our image and we're just going to select it to be the mini map that we just imported then in order to change the size of this image we need to go to the overlay and under the size y and size x here's where we will determine its size so i'm going to make this 512 and the x and 512 and the y and we also just want to select our image and make sure it has those same dimensions so in the x i'm going to get 512 and in the y i'll make this 512. so this will be the size of my minimap it's quite big although we can change this later easily and then you can just place the menu up where you want it to appear on the player screen so i'll make mine appear here in the bottom left and i'll just anchor it to the bottom left then with our mini map we want it to show our player icon on top of the mini map so we'll head over to the graph and on event construct we want to drag fifth download for create widget and the widget we're going to create is going to be the player icon that we just made we don't want to right click on this and promote this to arrival because we're going to reference this later you just call this player icon and then what we're going to do is head back to our designer and select our overlay and just check this is variable and we're basically going to add this player icon to our overlay so to do that we can just drag in our overlay and forget overlay and then drag up here and therefore add child to overlay hook this up to here the child we're going to add is going to be the player icon so we just want to hook this up to here and then from our overlay what we're going to do is just drag here and look for set horizontal alignment and set this to be center so we're going to make it so that this player icon goes to the center of um our overlay so we're going to do this for the horizontal and the vertical axis so then we want to drag up here and look for whoops i'll do it again we're going to drag up here go across that vertical alignment and then we want to set this to be center as well so position our player character icon exactly in the middle of this overlay next we're going to make it so that this player icon will basically accurately display where our player character is on the minimap to do this i'm going to head back to the event craft and then off of event tick i'm going to drag and look for set render translation so this one at the bottom and then for the target of this we just want to drag in our player icon i'm basically going to be saying the position of our player icon and the x and y on this widget blueprint so in order to accurately get this we want to right click and for get player character from here you can drag off and therefore get actor location and then from here we can right click on the for split structure pin and we'll be able to get the x and y coordinates of our player character then we want to divide these by a certain amount so if i just close this and i go back to my scene capture 2d you basically want to keep the note of the author width that you set for your scene capture 2d so here i made it 4 000 and what we want to do is just divide the x and the y value by that amount so i'll divide this by four thousand and then i'll also divide this by four thousand then we need to multiply these values the values we need to multiply these are going to be determined by on what we set the resolution of this image so in this um image i set it so that it's 512 by 512 so of the x we just want to draw here and look for whoops again over x we want to drag up here and for multiply float by foot and for the x value you want to make this a negative number so let me get minus and i'll make it minus 512 and then for the y value can be positive so you just want to drag there not for multiply and make this 512. so important the x1 needs to be a negative then we can just drag up here and a4 make vector 2d and then we're going to hook the x1 into the y and the y1 into the x and go compile so now we're going to have our minimap we just need to display it onto the screen so i'm going to go to my third person character and just make it so it displays this minimap pod so i'll go to the event graph and right click and go event again play we can create widget that widget is going to be the minimap and then we'll add this to the viewport compile and now i go play we can see um it displays my menu and one left and just place where i am let's say i move all the way up here my mini map is basically going to accurately display where my player character is in the world and will also accurately display their rotation so with that we basically set up the minimap so this next bits for extra learning so if you remember when we started for the scene capture 2d i said we should make sure that in the x and y the location should be um zero zero that just makes it easier to make the minimap however if you can't do that and you need to move your mini map a bit to the forward and the x and the y that's fine so we want to do then is basically um create the scene capture for it so we'll do that right click materials and textures and create a canvas render target for it and we'll just drag this onto here and as you can see in the x and y for the scene capture i have a value of 570 and a value of 280. so i'm just going to quickly create an image for this so i'll go to actions export this and then put it in photoshop and make this um an image so i've just imported and created an um image of that new render target so i call this minimap2 and i've just imported it into penal engine so if there are values in the x and y for our minimap we just want to go into it and i'm just going to change it to be my new mini map so minimap 2 and let's also just make it so it has the same resolution so i'll make it 512 by 512 and then we'll head into the length graph and then because we had a value in the x and y axis we need to account this in our calculation of where the player character is so if the value is positive in the x like here so it's plus 570 in our minimap what we want to do is just drag off the x and then minus it by that amount so we want minus 570 and then we want to hook this into here if say this amount was um negative then we would want to add and do the opposite and then we can also see in the y-axis it's positive 280 so we want to here subtract 280 so i look for minus float and again if your number and the y-axis was negative you want to add this number then we want to hook this into here and go compile and now if i close this and go play we can see that my mini-map basically accurately show where the player is it's just you have to do that additional calculation if you want to move um the render if you want to move where your scene capture component is anyway that's all for this video video if you could like the video it'll be greatly appreciated and subscribe and i'll see you guys next time bye
Info
Channel: Unreal University
Views: 18,344
Rating: undefined out of 5
Keywords: Unreal Engine mini map tutorial, how to make a minimap in unreal engine 4, how to make a minimap in ue4, mini map tutorial, mini map, mini, map, tutorial, unreal, engine, ue4, ue5, how, to, how to, uisco
Id: gIB6QaMDr8M
Channel Id: undefined
Length: 13min 49sec (829 seconds)
Published: Fri Feb 04 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.