1 00:00:01,780 --> 00:00:08,779 Well, in this video we are going to see or we are going to start working with Unity, so the first thing 2 00:00:08,779 --> 00:00:18,100 we are going to do is download the Unity Hub. The Unity Hub is this window that I am showing you here, 3 00:00:18,100 --> 00:00:26,219 which allows us to have several distributions of Unity grouped here and be able to create 4 00:00:26,219 --> 00:00:34,719 projects of different versions it also allows us to create a project in a version and change 5 00:00:34,719 --> 00:00:41,460 that version to a later and then it will allow us to load the different modules in the different 6 00:00:41,460 --> 00:00:51,979 versions that we have installed in such a way that we do not need to have all the versions installed in our 7 00:00:51,979 --> 00:00:59,899 equipos todas las versiones con las que trabajemos y además todos los módulos que harían esas 8 00:00:59,899 --> 00:01:05,379 distribuciones muy pesadas vale entonces nos encontramos una vez instalado y unity 9 00:01:05,379 --> 00:01:15,180 hub yo en este caso tengo el 3.10 diferentes categorías tengo la de proyectos la de instalados 10 00:01:15,180 --> 00:01:21,060 las instalaciones aprendizaje y la comunidad en los proyectos me van a aparecer los diferentes 11 00:01:21,060 --> 00:01:28,319 projects that I have right now or in which I am working right now on my pc it is worth in my 12 00:01:28,319 --> 00:01:36,180 laptop then you see that I have the unity video that is this one that I am doing now I have one 13 00:01:36,180 --> 00:01:41,459 that is my project because it will be another test one of quida that I did the other day in class and a 14 00:01:41,459 --> 00:01:50,680 presentation well if I am going to install what I have is the last the version of unity that I have 15 00:01:50,680 --> 00:02:00,579 installed in this case I only have one if I wanted to install more versions I can have them 16 00:02:00,579 --> 00:02:09,099 downloaded on my computer and load them directly from the location or the install editor that 17 00:02:09,099 --> 00:02:17,599 what it does to me is that it looks for the last one, in addition to different ones, we can look for all the 18 00:02:17,599 --> 00:02:23,840 versions that we need and we can install it is worth in this case I 19 00:02:23,840 --> 00:02:28,520 this afternoon or at some time I will install the 6 which is the one that we are the one that 20 00:02:28,520 --> 00:02:33,039 I have told you that you use in class is worth 21 00:02:33,039 --> 00:02:37,120 then from here we would install it would connect to the server and it would start 22 00:02:37,120 --> 00:02:42,560 to download is worth you see that we always have the lts the stable the 23 00:02:42,560 --> 00:02:50,479 últimas distribuciones estables vale pero lo que nos podemos encontrar diferentes versiones o lo 24 00:02:50,479 --> 00:02:58,900 que os digo de buscar nuevas vale esto es en instar en leer lo que tenemos son diferentes 25 00:03:00,439 --> 00:03:07,060 videotutoriales tutoriales para aprender a utilizar y a crear juegos en 2d en 3d 26 00:03:07,060 --> 00:03:15,580 ok we can have also to see examples of how to work with vr things like that 27 00:03:15,580 --> 00:03:20,740 then to learn these tutorials that they are putting us that they load us here by default 28 00:03:20,740 --> 00:03:26,199 they are quite good ok and the community the community of unity 29 00:03:28,580 --> 00:03:34,860 well here you have different tools that also when doing a project between 30 00:03:34,860 --> 00:03:44,319 varios o un control de versiones o cosas así pues puede estar interesante vale entonces yo bueno 31 00:03:44,319 --> 00:03:50,379 siempre que creas una cuenta para lograr se vale y me voy a project en project cada vez que yo 32 00:03:50,379 --> 00:03:57,479 quiero crear un proyecto nuevo le voy a dar a new project aquí voy a elegir qué tipo de proyecto voy 33 00:03:57,479 --> 00:04:05,099 do ok then you see that I have for 2d 3d and universal 3d we have here several 34 00:04:05,099 --> 00:04:15,120 vouchers for mobile for vr vouchers well we have several we choose we choose what is what 35 00:04:15,120 --> 00:04:23,759 what type of project we want to do well the structure well that is the skeleton that we are going to 36 00:04:23,759 --> 00:04:29,459 use it is also going to load some functions or others and it is not going to be the same the 3d 37 00:04:29,459 --> 00:04:36,300 than the 2d for example it is worth in the 3d we are always going to work with x and z in the 2d we are going to 38 00:04:36,300 --> 00:04:49,079 work with x and it is good it is important that you choose well because the core of your project is worth 39 00:04:49,079 --> 00:04:55,319 Beyond that, for example, if I choose the 3D, I will be able to make a 2D game, 40 00:04:55,459 --> 00:04:57,980 leaving the camera fixed, for example, okay? 41 00:04:58,540 --> 00:05:05,920 Well, then, I create a new project, here we tell it the name of the project, 42 00:05:06,199 --> 00:05:09,540 we tell it where we want to save it, okay? 43 00:05:10,019 --> 00:05:14,899 Well, we give it to Create Project, and then what it is going to create, 44 00:05:15,759 --> 00:05:18,860 what it is going to generate is this window, okay? 45 00:05:18,860 --> 00:05:25,980 in this window, which is the one I tell you about, which is the one of Video Unity, which is the project that I have just created. 46 00:05:25,980 --> 00:05:33,339 Well, I see different sections, it is a group of windows that are modular, that I can modify, 47 00:05:33,339 --> 00:05:41,379 that I could take and put them, distribute them between different screens, if I had different screens, 48 00:05:41,379 --> 00:05:52,379 to make the workflow much more comfortable, and I can reorganize it. 49 00:05:52,379 --> 00:06:04,379 We have here in this little button the layout, which is one of those distributions that Unity gives us by default, 50 00:06:04,379 --> 00:06:07,040 Okay, to see all those windows. 51 00:06:07,040 --> 00:06:14,019 So, well, we can create whatever they are and save them, okay? 52 00:06:14,019 --> 00:06:18,220 With the safe layout, we could delete it and then delete the ones that were good. 53 00:06:18,220 --> 00:06:25,379 I always use the two by three, the two by three, which is this view. 54 00:06:25,860 --> 00:06:32,779 In this view I find the scene, which is the scene window, which is where I'm going to go 55 00:06:32,779 --> 00:06:42,779 generating the 3D scene by putting the different GameObjects. Remember that in Unity there are no objects, there are GameObjects. 56 00:06:42,779 --> 00:06:54,779 So this is where I'm going to put the different GameObjects, placing them and seeing at the development level how to organize everything well. 57 00:06:54,779 --> 00:07:07,279 This other window that the game puts is how the user is going to see it, there you will always have the user's view from the camera. 58 00:07:07,279 --> 00:07:17,779 If you look, I have another window, the hierarchy, which is the hierarchy of the game objects that I am putting into my scene. 59 00:07:17,779 --> 00:07:23,300 It is worth that from always when we create a project. 60 00:07:25,540 --> 00:07:29,120 I will always load the main camera and a light. 61 00:07:29,660 --> 00:07:33,319 Now Unity allows you to create empty projects. 62 00:07:35,180 --> 00:07:47,660 And well, now it is that option, but with the previous version, it always loaded these two, these two components, because it understands that you will always need 63 00:07:47,660 --> 00:07:53,420 a camera and you will always need a light ok then if you look here the main camera and the 64 00:07:53,420 --> 00:07:58,759 live direction are these two little icons that put them here in small but that if you double 65 00:07:58,759 --> 00:08:09,560 click on it it will take you and you can see them ok well then the project window shows us and this 66 00:08:09,560 --> 00:08:14,839 window is subdivided into two sections this window what it is showing you is the asset folder 67 00:08:14,839 --> 00:08:22,699 that is the one you have created in the folder where you have indicated unity that creates the project 68 00:08:22,699 --> 00:08:31,660 from the unity hub window ok I want to say with that that everything that I add in the different 69 00:08:31,660 --> 00:08:39,279 folders or subfolders of asset I could add it directly from the disk ok 70 00:08:39,279 --> 00:08:50,659 So, well, all the structure that we are doing here, I have it saved in the hard disk, okay? 71 00:08:50,659 --> 00:08:55,320 And I would have access without the need to use the Unity editor. 72 00:08:56,039 --> 00:09:03,600 Well, and then, finally, we find the inspector window, which is where the different components appear, on the one hand, okay? 73 00:09:03,600 --> 00:09:07,340 You see that they come by categories, right? 74 00:09:07,340 --> 00:09:13,580 comes the transfer and in the light it comes no longer comes any more here I have a button to 75 00:09:13,580 --> 00:09:17,779 add different components to add more components as it could be a script 76 00:09:18,879 --> 00:09:24,580 and within each of those components there is a pair there are parameters that we are going to 77 00:09:24,580 --> 00:09:31,639 be able to modify because from the editor of unity or from a script it is worth the scripts they are always 78 00:09:31,639 --> 00:09:38,480 with cesar ok so they will always have the css extension all the games are going to have 79 00:09:38,480 --> 00:09:44,240 always a transfer a transfer a red transfer but that in the end they will serve to modify 80 00:09:44,240 --> 00:09:51,860 the position the rotation the scale is worth then those are going to have all the simplest 81 00:09:51,860 --> 00:10:00,120 the simplest game yet is an empty and the senses are going to have as a component exclusively the 82 00:10:00,120 --> 00:10:06,419 transform the rest of the component will always have more parameters, they can be components, 83 00:10:06,419 --> 00:10:14,179 sorry, they can be game objects that are simple as it can be the light direction or those that we have 84 00:10:14,179 --> 00:10:20,240 seen in class that are complex such as the button, not that the button had a father game 85 00:10:20,240 --> 00:10:27,059 object that was in charge of managing what the button is, the click is worth and then it had 86 00:10:27,059 --> 00:10:30,720 another green object that was related that was a tex 87 00:10:31,820 --> 00:10:38,220 that was in which we configure what text we want to appear on top of the button 88 00:10:38,220 --> 00:10:49,399 is good to put the different ones that there are not yet you have here the options to add 89 00:10:49,399 --> 00:10:54,740 what is needed or what I always do is right button and here it is also the same 90 00:10:54,740 --> 00:11:00,860 I am going to put the different images if you look here I have the user interface 91 00:11:00,860 --> 00:11:06,620 which is what interests me and here we have the different objects that I can use 92 00:11:06,620 --> 00:11:15,240 within an interface, I would put them from here, the first component that I am going to need 93 00:11:15,240 --> 00:11:21,480 is this one called canvas, it is worth a canvas, it is a canvas in which I am going to always draw 94 00:11:21,480 --> 00:11:34,480 well, the entire user interface, the user interface, I'm going to do it in x and y, okay, I'm going to load the different images, the different games, 95 00:11:34,480 --> 00:11:47,480 not everything I need in x and y, okay, then I select canvas and I see that the canvas has put me here and also added another game 96 00:11:47,480 --> 00:11:54,080 which is the event system, this is important because it is the one that controls all 97 00:11:55,580 --> 00:12:01,700 all the events that are going to occur within that canvas or any canvas we can have 98 00:12:01,700 --> 00:12:08,659 several canvas created but only one event system is worth if you see that you click on buttons 99 00:12:08,659 --> 00:12:18,740 click on the list of events that we have already used in other parts 100 00:12:21,220 --> 00:12:27,899 and they do not work is because that event system file you do not have it that file I am only going to 101 00:12:27,899 --> 00:12:36,500 modify it when we get into the vr ok but right now the only thing we need is 102 00:12:36,500 --> 00:12:43,159 is good I get into the canvas and the canvas you see it has in its inspector window different 103 00:12:43,159 --> 00:12:50,620 parameters one is the retransform in which I can modify the rotation the scale and the size we go 104 00:12:50,620 --> 00:12:58,299 the scale the size the pivot is worth I can modify the anchor points well we can do 105 00:12:58,299 --> 00:13:04,679 several things here this is what I tell you that this transfer is the transfer we are going to have it more or 106 00:13:04,679 --> 00:13:11,100 equal in all the games then I have the canvas and the first thing I find in the canvas is 107 00:13:12,100 --> 00:13:18,179 what type of canvas I want to use here gives us three options the overlay and the camera 108 00:13:18,179 --> 00:13:27,299 camera and the workspace is worth the associated to the 3d space the first two right now for us 109 00:13:27,299 --> 00:13:35,519 are the same but you have to or it must be in your head the idea that the camera the camera 110 00:13:35,519 --> 00:13:40,799 what it is going to ask me is always good first is the camera where I want to associate it not that I would take 111 00:13:40,799 --> 00:13:49,879 the camera dragged loose and then I can put a distance between that canvas and the camera 112 00:13:49,879 --> 00:13:56,899 in such a way that 3d objects can pass between what I am drawing in my canvas, 113 00:13:56,899 --> 00:14:05,360 it is worth the different panels, the different ones, whatever it could be, it could be covered or it could be 114 00:14:05,360 --> 00:14:12,279 covered by a 3d object that is passing between the camera and that canvas, it is worth, however, 115 00:14:12,279 --> 00:14:22,179 the over line because it does not make us that the over line does not have a distance between the camera and the 116 00:14:22,179 --> 00:14:32,259 camera in such a way that you will never be able to cross any 3d object we could make the 117 00:14:32,259 --> 00:14:39,340 cameras be displayed only for a certain camera in a game you can use several cameras 118 00:14:39,340 --> 00:14:44,320 ok then we have there well different parameters to me now the one that interests me is this one 119 00:14:44,320 --> 00:14:53,019 of the render mode ok we leave it in overla and if I go down a little more I have the component the 120 00:14:53,019 --> 00:15:00,159 scale of the canvas is worth the canvas scale and there I have a sky mode ok this is how I want 121 00:15:00,159 --> 00:15:06,440 that canvas to be scaled with respect to the resolution of the screen if I change the 122 00:15:06,440 --> 00:15:15,259 resolution of the screen the resolution of the screen changes from the game window from here 123 00:15:15,259 --> 00:15:22,320 we can put different resolutions and we can give the plus and make us a new resolution 124 00:15:22,320 --> 00:15:27,440 that we want we give it a name we give it that resolution and we give it what there is in such a 125 00:15:27,440 --> 00:15:32,960 way that later it will appear in this list ok we can create the ones that we need ok 126 00:15:32,960 --> 00:15:44,779 so I'm going to tell you that what I want is to modify the scale of the ui not that it is constant 127 00:15:44,779 --> 00:15:53,179 because then it will be more it will be worse I will say that I scale it with the size the 128 00:15:53,179 --> 00:15:59,720 resolution size of the screen the second option is valid and there what it does to me is to activate the 129 00:15:59,720 --> 00:16:05,720 reference resolution is worth then because here you would have to put the resolution in x and in 130 00:16:05,720 --> 00:16:12,679 and of the resolution that you are using in your equipment is worth and this is going to be 131 00:16:12,679 --> 00:16:21,159 important when we work with the anchor points is worth that we will see what it is but it will be 132 00:16:21,159 --> 00:16:30,000 important. Well, if you look at the different components of the different 133 00:16:30,000 --> 00:16:42,279 I have here some buttons that allow me to work with them, then I could 134 00:16:42,279 --> 00:16:50,509 erase that component, copy the component, well, we could do from the three points 135 00:16:50,509 --> 00:16:56,590 varias opciones vale estas que nos están mostrando aquí mover una arriba amor una bajo como un poco 136 00:16:56,590 --> 00:17:06,269 las típicas vale lo que me interesa es es este botoncillo que es circular con un signo de 137 00:17:06,269 --> 00:17:16,309 interrogación vale cerrado bueno es lo que hace es que cuando lo pulsáis os lleva a la documentación 138 00:17:16,309 --> 00:17:24,430 of yuni is worth that documentation in my opinion it is quite good then that documentation is 139 00:17:24,430 --> 00:17:31,009 divided into two on the one hand it is the manual and on the other it is the scripting then in the scripting 140 00:17:31,009 --> 00:18:04,210 For example, if I search, let's see, text, for example, this one, let's see, let's search, for example, let's see if it finds it better, 141 00:18:04,210 --> 00:18:41,390 the text does not catch me, let's look for this one or let's see this one of the fine with tag, it is worth it for me to look for an object from the code, one of the objects that we have loaded in our hierarchy window, 142 00:18:41,390 --> 00:18:51,390 So, Unity shows you, tells you what this function is for, and then it always shows me an example in this way. 143 00:18:51,390 --> 00:19:01,390 So, here it is telling you, okay, if what you want is to load within that variable that you have declared as public and of GainOjet type, 144 00:19:01,390 --> 00:19:10,390 which you have called the respawn, then you are going to put the GainOjet.findWithTag and it will look for the tag with this label. 145 00:19:10,390 --> 00:19:17,769 label is valid then from the hierarchy window it will go looking from top to bottom and when I find 146 00:19:17,769 --> 00:19:20,329 a label that is as we have said 147 00:19:24,150 --> 00:19:31,029 respawn is going to take that object and it is going to associate it with this variable we in class what 148 00:19:31,029 --> 00:19:36,670 we have done has been to drag because it seems to me that it is easier right now for you but 149 00:19:36,670 --> 00:19:43,069 Of course, we can do it and we will do it a little bit later. 150 00:19:43,269 --> 00:19:45,150 Well, then this is the documentation 151 00:19:45,349 --> 00:19:48,470 of Unity and you can access what I tell you, okay? 152 00:19:48,670 --> 00:19:51,789 From these circular little buttons you could access 153 00:19:51,990 --> 00:19:53,509 and I think it's going to help you. 154 00:19:53,710 --> 00:19:58,069 In my opinion, it's a documentation that's pretty, pretty good. 155 00:19:58,269 --> 00:19:59,829 Okay. 156 00:20:00,029 --> 00:20:02,029 Well, this video, so that it doesn't get too long, 157 00:20:02,230 --> 00:20:04,710 I'm going to cut it here and now, in the second one, 158 00:20:04,710 --> 00:20:16,009 I'm going to be adding panels, gain-odds of the type Label or buttons, so that you can see how it is and we make a script. 159 00:20:16,809 --> 00:20:17,990 A greeting, see you later.