How to make a COLOR SWITCH Replica in Unity (Livestream Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to this video this is a live stream tutorial on creating a replica of color switch which is a really fun minigame that you can see our works here so if I hit play here you can see that we have this bowl that we can control by pressing the spacebar in order to drum it's very much like flappy bird in this regard and we can jump up here we can only pass through the color that we currently have our ball and you can see a ball can change color along the way so I need to get up here and kind of time it correctly and you can also see that we have a little bug here where we can actually change to the same color that we're already on but we can have a look at changing that and it's it's really a game that you should expand upon in order to make more fun out of but I just want to show you how you can create these basic mechanics in the color changing and hit registration and you can really easily expand upon it to create more levels more shapes maybe even more colors and definitely some power-ups some scores and some cool death particle effects that's that's not a stuff to do here but today we'll just get out the core game so let's just go ahead and get started with this so let's go file new project and we want to of course create a 2d project and let's call this one color switch replica there we go and unity is just going to boot up all of the necessary files in the background here and meanwhile I'm going to have a look in the chat to see how everyone is doing is it infinite no it's not infinite I've done it you could very easily go ahead and make this procedurally generated simply instantiate in circles using some kind of random prefabs selected from an array or I could go the route that I'm doing here which is just allowing you to create your own levels but you can do anything like that it's it's really easy to add procedural generation to this so um and hi to everyone who is joining a lot of people tuning in that's awesome so on let's begin by kind of changing our background here to a darkish gray something like that not too inspiring but we want all of our colors to be overlaid on top let's also go ahead and save the seen here because I am a chronic saver and I cannot stop myself from hitting ctrl s let's go and save it as something like mane so that I can span that along the way and let me see oops I have something open here that I want to close there we go so um the first thing that we could go ahead and do here is maybe create the movement of our player so in order to do that let's go and create a new 2d object sprite and the sprite that we want to select here is the knob we can use that you can also create your own circular sprite and I want to set the scale here to something like 2 by 2 maybe 3 by 3 I don't want it to be too big and the color here we'll just stay white for now but you do want the base sprite to be white so that you can tint it during the game if the base flag was black we wouldn't be able to change the color so you can of course also have multiple sprites that you swap in and out but we'll just be tending this one sprite so you can see now here that we now can actually control the color as we want and we can do that at run time as well so let's go ahead and rename this guy to player and let's also add a new component and the component that we want to add is is a custom see sharp script called player and let's hit create a net and let's double click this to open it up in Visual Studio I hope you guys didn't miss too much all we did was create a player script and in here we deleted the start method and the to using system tags up here and we of course plays the script on the player and now we are creating a variable called jump force it's a public float and I'll just default this to ten and this is of course the height that you will jump and then we also need a reference to our rigidbody we'll be creating a rigidbody on the object in just a second and you can use get components for this but I'm just going to go ahead and make a public rigidbody 2d and call it something like RB so we can just drag it in in the inspector then in the update method will check if input does get button-down and the button that we want to check for here is jump we could also go ahead and maybe check for a mouse click if you want to use that button instead so I'm going to go input dot get mouse button down and the mouse button that we want to check for is zero meaning be a left mouse button cool so oh and we don't want this to be and we want this to be or so two vertical bars so that either one of these will trigger cone then we want to go ahead and jump and we do this by saying RB dot and we could go in here and add a force in the upwards direction using our jump force but that is actually not give us these going to give us the logic that we want because if we go ahead and play the mobile game or flappy bird for that matter these games instead of adding a force simply change the velocity of the player because if the player falls a certain distance we don't want the force to be to be competing with this downwards velocity instead we just want to completely ignore that and then give him a straight upwards velocity and that's going to give more much more predictable movement so we're going to instead going to go in here and say I'll be dubbed the velocity and set this directly to a vector to dot up multiplied with our jump force like that cool so now if we just go in here and save that we'll also go in and add a new component and we're going to add the red lips the rigidbody2d and also a circle Collider 2d and the circle Collider we are going to mark as a trigger and we also want to adjust this so I'm going to say point zero nine and zero eight I like this to be kind of a bit inside of the actual graphic so that you're certain that you won't have a situation where the player when I made that and he really did so you want that to be normally a bit narrower than the graphics of the circle and then the rigidbody here I'm going to bump up the gravity to three just to make him fall a bit quicker I find that that just makes the game feel more interesting and we can then take a rigidbody and drag that into the RB slot so now when we hit play we should see that we are able to yeh click a mouse or use our jump button in order to have this jumping movement and it's actually already really fun to do this so I could do this flowers anyways so um other than that that's not too much we need to do you could go into the rigidbody 2d here and add a constraint on the x-axis and also freeze rotation around the z just to make sure that our player will always only move up on the Y no matter what happens it's just good practice and then what we want to do is of course have some kind of rotating color wheel and you can make this a triangle you can make it a square some kind of pulley he'd roll publish something with polygon and you could also make it a circle it's totally up to you I simply went into Photoshop here and created this circle here which using the rulers which you can get like this I split up into four different parts one is sine one is yellow one magenta and one pink and I then copied this into three different sizes and made sure that the thickness of the line was always the same and then you can go ahead and X or any one of these elements so one by one exploit these into a sprite or you could go and make a sprite sheet out of this by simply separating all of them into kind of a on single image like this to make sure that you can splice it up any way that you want so I went ahead and did this to the small circle and that's what I have lying on my desktop here so this is just four parts of a circle that I've separated out a little bit and colored in four different colors and again if you want to follow your along using my version of this I will have it up on github when the video goes live on youtube so don't worry about that that will be a link in the description if you are watching this on YouTube cool so in here we don't need to configure too many settings pretty much the only thing that we need to do is change the sprite mode from single to multiple because we have four sprites in here and we need to go into the sprite editor hit apply and we then need to go up here and say slice and then slice and now you can see that we've sliced it unity has sliced this into four sprites and if we apply now it is going to be visible in the project panel as well we now have one two three four circle parts here so really quick and easy to do now we want to take all these circle parts and drag them into the unity editor to play with into our scene view here and we can maybe take all them and actually we'll move these in a second we'll take our player for now and drag them down a bit and for the circle talks here we need to let's see we need to set these up so that they align so let's take our first one or which is the second one here the one with index one drag that over until they align and I'm just going to do this using the measurement of my eye but you can of course go in here and do the math I think that's fine then we're going to take the I think it's this one nope the magenta one which is this one and we need that to have the same x value as the yellow one so let's copy the X here paste it over here and now we can take these last two ones the pink and the magenta and we can move those down together they're awesome and now we have a circle split up into four different colors and again be precise with this but because we on stream I'm just doing this really quickly so now we can go ahead and create an empty object and we'll reset the transform on that and we'll call this one something like a small circle in one word I'm going to do that cool and we can take all of our parts and put that those inside of this small circle here and we can also align these to the center so I'm just going to use the points where the color split here in order to align it to the center that would be there and there cool so now we have all of these different parts inside of a parent object called small circle that we can place anywhere we would like and when we now go ahead and rotate this parent object around the z-axis we should see that our color wheel is rotating along awesome just the way we wanted so we could go in here and rename the different circle parts now just to make everything a bit easier so let's name this one cyan this one yellow this one pink and this one magenta and I'm going to drag the magenta up here so it's right before the pink one and we need to select all of these different parts now and add some colliders so let's go in here and add some polygon colliders and this is not particularly pretty I will give you that but I actually found that it's the only Collider that kind of works for this instance because the circle Collider does never radius or I mean I doesn't have a width you can see that doesn't really work for our case we also have the box colliders but it's spending we could reduce experiment with some edge colliders that might produce alright-alright results here but we would have to configure these quite a bit so it's not really too much yeah that works better than the polygon colliders here so I think we'll just go with that we can take our play here and shrink down the radius of him even more to adjust for any kind of errors it doesn't have to be too precise they don't think for this kind of game cool so now we need to of course rotate our circle over time so to do that we're going to hear me add a component on a small circle called the rotator and this is also going to be a c-sharp script and let's double click that to open it up in visual studio reload all and everything is good we can delete the two using system tags up there again and we can also delete this start method once more we do need a public float here and this is going to be the rotation speed and I'm just going to call this one speed and the fold it to maybe something like a hundred so that means that we're going to move a hundred degrees every second so now inside of our update we can take the transform of our current object that the rotator script is sitting on and we can use the rotate method in order to rotate it around its center and we want to rotate it zero on the X 0 on the Y and we want to rotate it our speed on the Z multiplied with and this is important that you write time Delta time in order to make sure that we even out differences in frame rate I've talked about time to does a time a bunch of times if you want to get a better understanding of it I suggest you check out the on unity tutorial on a bullet time effect or slow motion that I have on my youtube channel there we go into time that does a time what it means versus time dot fixed of the time and all these different time related stuff so check that out if you want for now just make sure to write it here because then our speed our rotation speed won't be frame rate on dependent cool so now that we save that that should actually be all we need to do for our rotator script it's just hitting play and it's rotating and we also of course have our player movement working so yeah we have something that somewhat resembles a game already only thing is of course we aren't really able to lose or win but let's just call it a game we can call this one interactive art for now so now we need to take our player here and make sure that it will always be drawn on top of everything else that we make in order to do that let's create a new sorting layer and it's called this one the player layer and we'll select a player and apply that sorting layer there now we are sure that he is always going to draw on top um then we can go ahead and make the actual hit registration and we do have colliders on our different circle elements and we also have a Collider on our player so all we need to do now is go inside of our player script and you could definitely put this inside of a separate script and I'll create a method that will register whenever we collide with something and we know that method it's one of unity spilled in callback methods it's on trigger entered 2d and you use 2d here every time you're dealing with 2d colliders if not used to delete that and you have the 3d equivalent so Ontario into 2d is going to be called every time we collide with something and um what we want to do is gather some information about what we collided with because whether or not we lose or succeed totally depends on what color the object we collided with this and we're going to define the color of the object using a tag so we want to check first of all I gather some information about what we hit and then check if that tag is the same color as ours and if it is not well then we messed up so in order to gather some information about what we hit we create a variable here called collided to or of type Collider 2d and we can call it something like Cole let's refer to it as called meaning they Collider that we just hit and then we check if Cole tack is equal to whatever color we currently have so now we can just go ahead and debug the log call dot tag and that means that whenever we collide with something we're going to write its tag in the console so now inside of unity we can go ahead and hit play and we should see that every time we collide with one of these things it's going to say on tags because we haven't applied a tag yet then for each circle element we can go ahead and add a new tag I mean I can go ahead and add all of the different colors to this tax rate we have this sign we have the yellow we have the magenta and the pink cool so now for the sign we'll add the sign for the yellow we'll add the yellow the magenta we'll add the pink and screaming will add the magenta and for the pink will add the pink code so now we have all these different objects with the correct tax applied and yes you could go ahead and use the name instead of the tag it's a bit maybe a bit too much that I have all them change names as well as tags but I think it's better to use tags because then you are reducing the amount of places that you could arm that you could mess up your writing so definitely recommend using using text for this so inside a visual studio we can now check okay let's just see if this is working first so we apply here and we collide with Sian it's a scientifical ID with yellow magenta it says yellow and magenta and the same thing with the pink cool so now inside the visual studio we can check if Cole tag is equal to and then we can check if it's equal to yellow we can check if it's equal to magenta and you get the idea however we of course need to define a color for a player in order to to do this check so how do we assign a color to all players well there is a bunch of different ways that you can do this and this might not be the prettiest but it's really easy to understand and quick to set up so this is probably the way that I would go about it if I was doing a gem and that is simply keeping all of the code inside of the player method you could go ahead and separate this out into a color manager method that has an array of colors maybe an in enumerator or an enum instead with the different colors with nice with a singleton pattern and you can go ahead and call functions for setting and getting colors and all that fancy stuff but that also doubles development time and because this is a live stream we'll do it the quick fast and fun way and that means that we'll go in here and we'll create a public string and this is going to be our current color and we'll default this and we actually don't want to default this will also make a void start and right when we start the game we want to get a random color and we want to do this multiple times during the game so let's just make a method for that let's call it something like set random color and let's go down here in order to create it that students at the bottom so void set random color and because we know all of the different colors that is going to be in the game which is only four and we know that we're never going to change this and so I'll write to hard-code the same so we'll go Ginn's index in order to get a random value between zero and three meaning zero one two three four different numbers equals random range so this is going to give us that printim number between zero and three and we can then go ahead depending on what number we got switch to a certain color so we'll make a switch statement here and the value that we want to have different cases for is the index and will open and close some curly brackets and then we can write out our different cases now I found out recently that a lot of people actually aren't familiar with using switch statements a lot of beginners only know the basic if statements and maybe a four or for each loop switch statements is something that you don't use as often but they can just be really handy syntax wise they basically allow you to more easily create a series of statements we could go into and say if indexed this equal to zero there's one thing is I do one thing and then else if index is equal to one and then do something else and then keep on going for all of the different are cases but that is pretty syntax heavy and it's also um it doesn't allow you to do or it doesn't as easily allow you to do stuff like default cases um breaking and or falling to other cases I'll show you guys this in a second so here we basically do the same thing we say that we want to have a look at our index value and depending on what it is we want to do different stuff in the case that it is zero we want to do this line right here and what we want to do here is maybe said our current color equal to I will just use the first one which is sign and we then break which means that we exit the switch statement then in case one we want to set current color equal to yellow and we then break as well in case of two we said current color equal two and then we go on magenta and we break us once and in case three we set current color equal to armed and we'll go pink cool so we very easily go ahead and define different cases and if I'm not mistaken this is actually also lighter on the compiler so this will actually happen quicker but there might be some optimization behind the scenes where it recognizes these patterns and if statements and automatically convert them converts them into switch statement I don't know exactly how that works so I'm not going to put my word on it but um your switch statements they are awesome so we have all these different cases and now we should see that when we start our game our current color get set to random color so let's hit play here or let's elect our player and it's hit play and we should see the current color here set to magenta if we try and do that again it's set to yellow whoops with a spelling error and yeah you can see the yellow again there we also have the Scion awesome so I just need to go in here and this is really the danger of doing it this way is that you are prone to spelling errors so make sure to spell things the exact correct way and thank you for pointing that out in the chat I might not have seen it um so yeah so now we set a random color however you will see that the color of our object doesn't actually change so in order to change that we need to access the sprite renderer and set the color property so how to do that we need of course a reference to our a sprite renderer sprite renderer and we'll call this one SR and we also need four different colors we could just go in here and use the default ones color dots I and called magenta actually if it has all of them doesn't have pink all right we'll have to do it then so we can go in here and define our own one we're going to create a public color and this is going to be our color cyan we'll create a public color color um yellow that's a lot of extra typing for this one color magenta and public color color and then pink cool so down here we can then set s our color equal to color cyan or and down here we can do yellow down here we can do magenta and here we can do pink so color yellow color Jesus color magenta and color pink ha I think we made it guys I almost passed out at the pink one too many colors Jesus imagine if we had five or six all right so um why don't you use a color array and use the int as index you could do that just as well and it wouldn't make a difference I'm just hard coding things in here because I don't want to do extra work but you could just as well use anyway if you want so whatever you want to do so that should not work and if we exit out of on Visual Studio we can see now that we have a sprite renderer slot where we'll drag this one in we'll have all these different colors so we can go ahead and color pick the sign here and make sure that you pump up the alpha as well or else it's going to be invisible so make sure to full max out the alphabet on all of these as well so we'll set the whoops that's not the pink one there we go and for the pink here as well cool now when we add play yes we turn into a random color that's awesome we don't actually have this comparing of the tanks yet but that is really really easy to create on top so we had yellow twice in a row there and now we have sine cold so now all we need to do is go into the script here and use and use on trigger Institute II here to check if collider tag is equal to our current color and if it is we pass without anything happening however if it is not we messed up and bad things will happen so we're going here and throw a game over there we go so now if we play and jump up here so now we are signed let's see what happens if we make the jump everything is good but as you see whenever I touch any of the other colors it complaints cold and this is why you would go in and put some kind of death effects some kind of shattering into a thousand pieces and colored some kind of screen shake on the camera and then a way to restart the level we won't be bothering too much with that we can maybe go ahead and restart the level in just a second but first I wanted to show you how you can expand upon this so on the next thing that you probably want to make is a way for us to change color so let's go in here and create another on 2d objects sprite and we'll make this into a knob and we can make this two by two as well reset the transform actually and then make it two by two and we can drag this up on the screen here and we can make this on change our color actually of course if it's outside our screen we need to also have our camera follow the players so I actually just changed my mind let's leave this color changer here for just a moment while we make our camera follow the player so in the original game basically what we have is a situation where the player gets to jump freely but as soon as the player passes the midpoint our camera is going to follow him up so we basically have a still camera that makes sure to always stay at the same if not a greater y-value than the player and so if we add a component here called something like follow player or follow target and we double click that and in here we again get rid of the system namespaces we create a public transform which is the reference to a playroom we can call it either player or target I'm just going to go with player and inside of our update method here we simply check if player dot position dot y is greater than or equal point it's greater than transform.position dot why so if our player has passed our current position we're going to set transform position equal to a new vector3 where on the x we have zero on the Y we have players position dot Y and on the Z we have negative ten or whatever your camera has you can also go in here and input transform that position dot X and transform that position dot ly it's not really going to matter too much in our case but this is a bit more stable it allows you to change things in here without stuff breaking so um yeah let's see here so people are saying random dud ranges between 0 & 4 I do not believe so let's see here's the people spamming that's quite a bit in the chat so I think for integers they are both inclusive so let's see here random that range zero and see here returns a random integer between minimum inclusive and maximum exclusive all right guys I'm sorry I messed it up you're right it should be between 0 & 4 good call Jesus I almost messed that up that makes sense because it's it basically the inclusive exclusive stuff it's made this way so that you can just use it with the length of an array without having to worry about it and the length of an array is always 1 greater than the index of the last element so that's why it's made this way but thank you for the save guys the spam can can stop you guys won good job cool so um yeah so now we have a reference to our player or we have a slot where we can reference our player and we can just drag him in and we should now see if we're playing that in the beginning here nothing happens and then as we continue upwards our camera is going to follow our position and it's not going to follow it down because I players that's falling down well then he's messed up but it's only one way to go here and that's up cool so um then what we want to do is of course have a look at the color changer here so I'm just going to go make this um black where these darker and I think in the original game it was a multicolored like on the circle here so you can go ahead and make a fancy sprite for that but for now I'm just going to do the dark one here and we actually don't need to add a custom component to this what we're going to do instead is simply do the triggering here again inside of the player I mean that's a bit easier at least so instead let's go up here and add a new tag to this and it's called this one on something like color changer and also on the color change your object we'll go ahead and add a circle Collider 2d and we'll snap this in Vice just a tiny bit so point zero nine cool so I believe that's pretty much all we needed to do for the color changer itself let's actually go ahead and turn this into a prefab and we could do the same with the small circle but I don't think that ok that's do it let's turn that into a previous one so now our color changes here which then we go into visual studio we check if code that tag is equal to color changer and if it is we're going to go ahead and set a new color so we're going to say set random color and then we're going to return so that we are not going to get a game overstatement cool so if we now hit play or whoops we also need to set the tag for the color changer man some of these things today it's it's bad so let's apply and let's hit play and let's see if this is working so we make it through here and we make it through there and indeed we change colors every time look at all the color changing it's awesome of course we also need to consume this um a changer here whenever we do this so let's go into Visual Studio let's say let's find a place here and we basically just want to destroy called dot game object there we go again if you're going to make this more serious game that you're going to work more on separate some of this code out from the player script it's not good to have all of this in one place it's just not good and maintain containable code this way but it should work so now we can jump in here and we can continue up and it consumes it and we change color so that is awesome of course I advise you to go in here also under your set random color and add some kind of a check to see if the color you've chosen is the one that you already have and if it is pick a new one so that's something that you can experiment here you don't want to change to another color that you already have this becomes a tiny bit easier actually if you're using the method where you add an array because it allows you to kind of simply X or remove an element from that array which is your current color and then picks a random one in the new array and then put everything back in but I think this method is simply too easy to to pass up cool so that's pretty much all of the logic that I wanted to show you guys how to do today I mean from here it's just a matter of creating some more levels you can duplicate the color circle and move it up here we can make another version of the color changer here we can go ahead and make another version of the circle and this time we'll go ahead and duplicate it and instead of just slicing it up here I do definitely recommend creating a nother sprite which is larger but has the same width because this way you are going to get varying width and then for each circle here we can vary up their speed so we can do a negative 40 on this one make it pretty so actually let's do the opposite let's make it super fast let's do negative one sixty and forth on this one we can go one hundred and then for this one we can go one hundred and 150 here so if we now hit play we should see on that we can actually play this pretty much the same way as the online game man I suck it's a good thing we haven't implemented scene reloading yet so yeah wait for these two to sting up and then go through wow I'm bad so um yeah so the final thing is just reloading the scene and in order to do that we simply go in here we use the whoops you singing unity engine that scene management and down arm here we say if Collider the tyre is not equal to current color we throw a game over statement and we say scene manager dot load scene and the scene that we want to load is two currently loaded scene so we get Seemandhra get active scene dot build index because we need to feed it the index at the scene and we then say that and boom we should have reloading when we mess up so let's see yes cool so that's all I wanted to show you guys today I hope you kind of like a little mini game here which I really really really need to improve on let's see if I can have like one go through if I concentrate don't talk too much oh Jesus oh this is the hard part now I didn't make I'm sorry alright so bad you're supposed to be good at the games that you make oh cool guys so I hope that you learned something from this example and now we'll go ahead and transition over to a Q&A style themed thing where you can ask all the questions that you want and we're also going to have a look at um the bottom tower game so maybe also play some others other guys a Ludum dare games that could be pretty fun but will definitely switch over to a more real next format now and yes that is the tutorial in so yeah remember that both this video will be of am YouTube and the entire project with scripts with the sprites that I used here and all the project files will be up on github so don't worry about that and also if you don't want to wait until this airs on YouTube you can go ahead and watch it immediately after on Twitch but that times out after a couple of you of weeks so let's go and switch to Q&A here is so there we go so ask away with your questions and I'll do my best to answer them as usual so let's see here um Q&A time yes so are you working on some game yourself or do make tutorial video streams exclusively I'm not working on a larger game project right now it's not something that I feel I have the time to do on top of everything else that I'm doing as you say with um with the videos and livestreams and dev assets but I love to do smaller hobby projects on participating in doodleberries it's just so much fun fun to do so it's not not because I don't want to it's more time thing the video will air on YouTube on this evening so later today I am how old am I haha twenty years old that is my age um [Music] seriously I wasn't out there for a second um can you make a video about writing basic shaders I think I covered doing something on shaded programming could be really fun at some point it's not something that I am too good at I mean I know how to write basic shaders and I know how to get some stuff of a running but for example for this first shader that I use for this is autumn dire I actually used another tutorial on to do that because it's not something that I immediately just knew how to do a really great one by N's nissim you can check that out he does a lot of graphics programming stuff that you can check out um let's see when I'm going to make a video about AI Oh soon it is coming I've actually been talking to some guys that we add unity and we're talking about ways that we can kind of collaborate on on video stuff with the unity learn team and I know both for them and for me like AI and knavish and the new national system is pretty much on the top of the list so you can you can definitely count on something being made there and someone has birthday congratulations it's awesome um let's see can you please make a tutorial about making a car that actually works something with car physics could be super fun now definitely I would I would love to do that at some point will you be doing a new tutorial series soon I don't have any plans for a particular series right now I've been enjoying doing standalone stuff quite a bit I just did three videos on kind of shooter related subjects which was all kind of for weapon related stuff which was weapon switching shooting with Ray cast and an ammo and reload system so that was kind of mini serious like but I don't want to go ahead and venture on out into any any large series me know what got you into YouTube that's a good question I actually started on YouTube with making um well in the very beginning it was montages of video games I really overrated montage stuff added a lot of fun with that um I started in Sony Vegas just mixing things together moved on to premiere moved on to After Effects and yeah when I went crazy from that stuff like I did some counter-strike montages some Call of Duty montages I also did Tudor was way back in the day on After Effects before really knew how to to do anything so I hope you guys won't find them ever I need to private them I think they are really embarrassing that's kind of how I got started with YouTube always been interested in the chin the nerdy tutorial stuff what's my favorite game hard question it's been asked before these these dreams I I actually don't know the answer I'm sorry I maybe it was the for craft um let's see um may I ask if you're needy was the first game program you made as a new user here if so where can I hear about you I'm not sure I understand the question sorry um let's see have you tried VR it depends on if you mean developing for VR or tried out some VR equipment I've definitely tried playing some VR games got my hands on the oculus development kit when that was really new I've also tried the HTC vive as some of that different stuff I've tried a bunch of on VR solutions now actually and it's it's really fun it's never really been much of an interest for me per se I feel like some of some people are really really into VR stuff um but I don't know it just it's fun for me but I think it's not something I would personally use on a day-to-day basis and it's not something that I have a huge interest in developing for let's see do you have a lot of experience in unreal if yes how do you feel when switching from unity and vice-versa I don't have a lot of experience in unreal I know my way around unreal sort of and I've used it for some things but I would never ever say that I have a lot of experience in unreal unreal II something that you have to develop for on a day to day basis in order to be I feel I'd say it's a huge Peters piece of software and it's constantly changing and yeah yeah I'm familiar with unreal that's it what age did you start creating games um don't know I think I started creating games when I rust around ten but when I say that you must take it with a grain of salt it was the simplest and simplest of software it was an old version of game maybe not the current game maker that we know now but a very very bad old piece of software from another company which was oh it was so bad I started making games in that moved on to the blender engine which I where I did a bit of being visual nerd scripting and then discovered unity and was just amazed about how much you could do and just how much cleaner of a tool it was and everything I'd been using so far so I think around 10 but it didn't really catch on until I was 14 or 15 or something like that um let's see I will object pooling mega huge difference in performance in this case what we're not instantiated anything so you wouldn't need to apply all the object cooling if you mean like enabling and disabling objects as we go it totally depends on how long your level is if you want to do a procedurally generated world here I would definitely recommend it especially because this is a kind of meant for mobile or with game so that would make a lot of sense what is the first game engine I used well that was the game maker if you can even call that thing an engine bad guy oh if any of you guys have ever used the old old game maker and know what I'm talking about I don't even know they don't even remember the name of the company anymore but yeah let me know how did I learn coding from tutorials have like two books and practice do you think it's worth it to learn c-sharp at school or learn it yourself well it really depends on how you like to learn if you are very much a social Persian person and need to be in kind of the social environment with others in order to learn something when then school can be great for you or if you feel like you don't have the discipline to sit down and learn a skill for yourself then school can also be a good way to do that you put into an institution and your deadlines you have things that you must do and you have a time where you need to get there and so um that can really help drive you along personally I don't do well under that kind of environment I'm much better at just putting tasks laying out tasks for myself and then completing them at my own pace and because I want to also because when you are self taught you can go ahead and not maybe focus so much on the having to learn all sort of stuff and then instead focus on the fun projects that you can do and and what something inspiring that you want to make and that that can really help drive on inspiration and fun in learning stuff like this that at least for me that is the main thing is just finding something that you want to make and then learning the tools required to make that that's always been the way that I've worked if I just sit down and say today I'm going to learn C++ I might write some C++ I might get a better understanding of C++ it but it's never the way that I get proficient with it that only happens if I have a project where C++ is required how long did it take you to grow your hair well it depends on the length I mean this long here it's really getting wrong now that has taken a taken a long time like a year or something but we're almost having cutted like trim day only but I mean it it took me three four months to grow long hair why don't you give object-oriented design tutorials well I do a lot of tutorials on object-oriented programming languages but nothing on like object-oriented design patterns so I don't know why haven't had that many requests for it that's why can you teach us how to make our game audible laudable functionality really depends on the game and it's something that you write particularly for every single game if you mean creating some kind of multiple script or some kind of mod scripting language like Lua there's plenty of tutorials on that actually cool eighteen is probably the person to check out he's done a lot of stuff with modding games so you can check out his tutorials but I don't have anything on the roadmap right now um let's see why don't you shake I do shave please be nice I shave regularly maybe not today but like few days ago um let's see are you a programmer or is it or is it a passion both um which programs did you use for little diary I think guys I think it's time to have a look at the little diary don't you want to do that I think I think I want to do that let's let's do it let's have a look at some dumb diary stuff so let me transition over here to my main scene there we go whoops look there are hundreds of me dancing actually there's as many of me dancing as there are pixels on the screen okay so let's uh find it here I'll just take away dancing me and let's go to the LG Chem website so I'm just going to log in here and I'm going to do that on the server monitor here and let's have a look at first of all of course my submission but also some of the ugly stuff on here so um cat first do you guys want to see the cat that receive this anything nearby look like the hero now I'm sorry I will make sure to pick them up if they if they come so yeah this is my submission it's called shrinking planet and die it's about little red car that drives around the road he likes driving and suddenly the planet gets um rained down upon by meteors and it's about surviving as long as you can there are links here for windows/mac and the source I'm just going to link this in the chat there you go if you want to go ahead and play it and here are the tools here so I have a bit of information here you can check out the the making off video it's right here I used unity five point six everything is written in C sharp I used Visual Studio as the code editor use Photoshop to do all the graphics stuff oops I forgot one I also use blender I'm gonna put that in here right now I used blender for all of them on there the modeling I used adobe audition for these sound and Busker sorry but you can see all something this this soft right here for the audio so a lot of fun and I'm just going to go ahead and play this now so let me bring it up I don't even know if I have it installed on my own system if I even created an installer let's go and find it on a project and then load them dari 38 and here we are build windows and here we go through the game boom and we should see that it jumps directly in here cool let me just actually turn on whoops oh no there you go mute myself and let's see everything is going crazy at once panic there we go okay and let me turn on test of audio here let me know how how loud this stuff is and if I need to balance anything up okay so here's the music and here's the game and I actually really like the menu screen that I decided to do here I like the fact that you can actually control the car during the menu screen here you can drive around you will just be able to drive through meteors because I didn't want the play to die going the menu but we have some controls you can quit and you can play and am I going through that include just to make sure I'm just going to bump down the music even more here cool then we can hit play and it's going to do the school zoom out and cementing and we are in the game and this is what it looks like I ended up doing this UI that followed kind of the shrinking planet which I really liked I spend a lot of time on kind of the graphics polishing for this game and wow that was that was bad let's try that again I did a lot of fun I work on the graphics polishing if you have a look at the smoke particles here you can see that I'm using the new noise filter for the particles which makes them look so much cooler and the cool thing is that as the planet shrinks so does the meteors here and they will actually disappear after a little while so you won't get too cluttered but it's still fairly highs and fairly hard and you have to have good reactions in order to do this so yeah it's the game let me see how far you can get here and then we'll boot up the unity project sorry I cannot talk while I'm focusing this no assets of that my personal record is 27 meters I know it doesn't look like that right now I think it's all was also the record actually that's not true my present I reckoned exactly is 27.5 and sophia's is 12 27.4 so please try and beat that so um yeah it's let's boot up the identity project here and i'ma show you around and I can see you requests on me trying out um Sebastian rigs game which yeah sure why not um so let me open up wait is it am I just totally missing it here oh it's probably because I moved it let me just reopen it and this is the low domed array 38 shrinking planet looks like that folder and have unity booted up we can have a look at it let's see here cool yeah and you guys got the link that's awesome this might take a little while because they are quite a few assets in here that's meanwhile while we're waiting we want to boot up let's check out Sofia's entry which I'm also going to link you and let's find this with a direct link called Meetup and she did a really cute I thought and kind of original twist interpretation of the theme it's about avoiding people you know on the UH on the street so you don't have to chat with them kind of another interpretation of a small world which I think was really nice so I'm just going to go ahead and throw you a link here and check that out I'm just going to boot up the web version here and show you guys what this looks like and see how well I can do let's see if everything is working here made with unity awesome so yeah she is called Betty our person of interest and these are the people that we need to remember so green red yellow black and blue all right in do that the music is really groovy here ah I'm counting myself at every single decision I don't is black like I think not her he's fine right yeah awesome and this one is definitely fine I love this sweater here see not that one he's fine as well that one is dangerous I think yes good yellow is dangerous as well right you guys can just screenshot it and see how bad this is yeah so with off I messed it up so really cute game I think stuff that could be added to this is a kind of a score modifier or score counter that shows how many friends or non friends that you've passed and maybe also something that could kind of expand upon the depth of the gameplay is have an array of people that you know and have that slowly get larger and larger so that the more you play the more people you know and so you both have to pay attention to that and remember new people as well as who is passing you by I think that could be a pretty fun thing and also of course when you're actually run into something have some kind of chat bubble up here um where where you're talking and you have to kind of sit through that that could also be be pretty fun so but really fun little game I think I'm pretty well done for for first time of course I am also biased so here is the UM the project for a shrinking planet and if we run and hit play here I can played in the editor and if I just pause this we can have a look around so basically the way that I did this was I created a planet which starts off at one one one and I the graphic here is just a sphere that I made in our blender it then has a Fox gravity attractor and I used a combination of different tutorials in order to get this right because I tried doing it on my own and I made it over complicated and this one is super simple it's something that I've done many times just implementing normally normal gravity attraction and then what I did was I wanted some objects to not only be attracted towards the center of the planet but just snap on top of the surface of that planet and there are used move position to just place them at the top of the planet by getting a vector that points from the center of our planet body dub position or transform the position and then subtract that from our body the position which is whatever we attracting here in order to get in a vector from the sender to a body normalize that and then multiply it with on the scale of our planet times the radius so just the radius of our planet so what this allows us to do is as our planet shrinks our car is always going to be snapped right at the top of that planet and that together with the script that shrinks the planet actually does all of the gravity calculations for us then all we have to do on the player object here is have a gravity body that places it on the surface together with the attractor and then a player controller and this is actually fairly simple recently move forward using RBW position and we don't have to worry about the fact that we are going in kind of a tangential line to where we want to be because that's going to be handled by the gravity attractor and then we simply apply some rotation to make sure that the bottom of our car always points toward the center and we also apply some rotation on top of that that is input driven and that's what I do here I get let's see here where is this that's here I get a delta rotation by converting our Y rotation into Euler hang or from Euler angles into a quaternion and I then apply that to our current with the body rotation and I then kind of smooth it out a little bit so yep ended up working it's maybe not the prettiest thing in the world but it ended up being fairly simple at least compared to what I did before and what I really liked about this one is probably just beyond the grasp and I ended up making I think it looks awesome and it's really really easy to adjust this wallet we go ahead and check the planet here and the grass shader and I want to switch to the default controls here actually let me just bring up the material two instead so we don't have this highlight you can see the awesome knobs here and this is all thanks to the tutorial that followed by Alan Taccone we can see how we can still have smoothness on the planet not that this is something that you particularly want actually could use a little bit and a metallic slider but much more important we have furlings you can go totally nuts with this we have the Alpha cutoff for our texture and the texture used here is just a symbol noise that we are generated and applied a few filters to you cut off at the end here we have the fading the amount of fade at the tips the gravity direction if you want to kind of shift that in a certain direction which is really really cool that you can do that as well on the gravity string and we also have stuff like the rim called oops this is something that I tried adding on top where is it um wind power where do they place this this is not yeah I ended up not using this I remember I tried to add kind of a rim fill but I didn't think it looked cool and so I removed it but for some reason I haven't removed key yeah I haven't removed the properties but it was in there at some point and also on the the particles for the meteors I think worked pretty well here you can bring up a media and have a look at it there we go and you can hear the sound here as well as we get closer this is just me saying Shh what I ended up working just fine actually let me play this and having a meteor that is actually flying towards the plane you can see I've messed up the shader here now but it's alright so here it is so I think this ended up being pretty cool I had a combination of trail rendering some particles and yeah just a bunch of particles actually on the light if I go ahead and play it a bit further here we can have a look at it once it gets closer to the planet let's take this one here you can see the actual light emitting on the arm planet we have this trail here if I go ahead and disable that you can see the effect of this so we have the sparks flying off it what's not simulating oh so annoying anyways on top of all the particle systems I have a trail render as well which just helps kind of define it a little bit and at the very tip I made sure to have kind of a clear if I select one of the other meteors I have kind of a clear um emissive texture that um I painted in Photoshop so that's this one under the particle system here the renderer the flare this is something I went into Photoshop and generated using just some noise filters and a bunch of glow and a bit of color and it really helped tie everything together at bat in the beginning I simply use the default particle and you can see that really doesn't look nearly as powerful but as soon as I went in and created this I really helped bring it to light and then of course the awesome part is the the smoke here has noise supplies applied to it which is what gives this random cool look also I have some skies in here around the planet that it are noticeable but just kind of a nice detail to help give more of a 3d feel to the game so yep pretty satisfied with the result of it I'm just going to undo a bunch of times here and and jump out of it and finally on do you guys have a game that I you wanted me to play I can check out the best and legs game for sure if you don't know him he's another job awesome unity tutorial maker check him out he made a game about ah a turtle which he also made a making-of video on I'm just going to get a link to it here find that real quick let me see the check see here yeah let me just get a show of hands how many of you guys participated in Ludum dare it right I did in the chat if you did that would be awesome to see here we go so I found this video and here is a link to the game there it is space turtle right so let's play it it's on edge that IO and hopefully ah know WebGL link wonder why all right I'll just go ahead and download it for windows here shouldn't take too long um let's see oh yeah awesome multiple people here oh thanks for the link to space turtle - I was too slow to see that it's an OGG M game here okay so let's try out space turtle here let's raise turtle extract all right here come on speech - there we go let's boot it up this is pretty cool I mean of course the levels here are procedurally generated and he did a lot of work on kind of smoothing out the planet and the ropes required a bit of math and I can understand from his video that he had a bunch of trouble getting things to work as he wanted them to but let's try it out it's pretty cool that he also added a networked high score you can check out his video if you want to learn more about that I actually didn't have time to do any kind of high score system I was too focused on graphics so hats off to you sir it's nice it's really good to have in these kind of small competitive games just some idea of how did I do it's really nice I think my game is is very much lacking in that department but yeah you can see the ropes here they are definitely working and it kind of adjusts itself to the position of of the arterial slowly whoops that was violent ha ha ha that was way too vile it Porto I and the planned explodes just using a bunch of rigid bodies it's it's definitely nice he also does a lot of other game development tutorials stuff you can check out some of his other making of videos or I think he calls them behind the scenes okay I'm too bad at this he did some some jams as well which were very published um so let's see ah who participated a lot of you guys did that's awesome if you guys have some links I can try some of it out here I've got one here this is from your sink la nine nine one oh this is beautiful oh I really like the graphics here it's awesome um and know what Yelp why why you guys no matter what deal um I mean I can I should really be mistaken this this is not made with unity but alright anyways I'm going to download it looks fun if it want to download uh yes okay so it's downloading twice now alright we only need to download once room number data Andrew normative exe I'm just going to put it up here transferring and I need to bring up the chat again so just disappeared cool run I'm excited now um I'm probably just gonna play this in there in window just so I can see everything else while it's running oh nice room number start oh also the music loving it start I have no idea how to play this welcome to the room number he had some rules to play this game may be you don't like it but I know you will have a great mind you can only move in one axis to move along all the tails and stand in front of the gate to open it you cannot move through one child twice you can see a cube in this level maybe is an obstacle or friend okay I didn't get a chance to read that I have no idea what I'm doing I'm just going to okay to cube don't know what I'm doing probably just trying to get over here right yes no oh I messed up okay we start yes yes I don't get this Oh everything needs to be read right okay yeah I got that but how how do I get past this guy this is this is too difficult for me am I being dumb or do you guys get this I'm sorry the setting is too awesome here I'm loving the click mechanics and I'd really like to highlight here click on the player okay I have to read this ah take the character I'm sorry ah there we go oh this is awesome loving the sounds and and this shifting colors in these make it really nice old portals yes so this takes me over there I would imagine and do I need to click on them to use them I'm still confused I'm just going to move in this direction okay and then if I move down here and then here and then over here let it correct I'll do that but I have to move here is that Alright and then there and over there yes no no ha ha I talk too much really well done game I think probably because I'm skewing right now way too difficult for me way too quickly I suck but I really liked the feel of the game the graphics are nice and once I get that you could click on the character it's also pretty self-explanatory what you're able to do so awesome love it do you have more things from you guys here's one by on no kill this nope nope nope Noah Noah Kellis I'm gonna try it out here we go hey this is not um dari where is gluten where's the dari 14 days ago this is not good embarrassed to try what my team made yes bring it on okay play the game to do to do this looks really cold game link yes please and download for Windows yes it's downloading awesome let's see what other games do we have lined up yeah awesome so let me just drag this over here and we can pull it up I keep shrinking the chat for some reason there we go need to make sure that I don't miss something ah and here cool tabletop arena run and again probably want to run this in window what do you think about window frame the window uploading directed if I'm so cool hey oh what's up I'll so to teach you how to play the game oh it's about to move yeah left click to stab oh yes it's a dummy oh this is I'm already having fun with this okay you're probably supposed to save it I guess we're also - by pressing shift okay that's really rewarding yes Congrats hahaha I love this SMS yep okay can i buy okay that's it awesome let's do this play the game okay so it's kind of an arena survival game classic top-down the dashing axe actually also damage enemy so it's it's only stabbing ouch okay it doesn't look like it oh this is awesome loving the techno music as well this guy probably whoa it's magic ouch this is just me embarrassing myself oh my god Jesus oh come on why I I can't hit the guy it's not it's not possible to be this bad come on Jesus what do I have to do but yes I did it right he's done what are the potion that's a - trailer ah I'm dying [Music] this Jesus no norm of this no more public humiliation I'm done guys that's all you're gonna get I'm sorry it's ah ah - horrible oh so much okay we're going to rev it up you guys that I had a lot of fun today often playing some of you guys games we can maybe play some more on next livestream I know it's going to be a whoops holy I know it's going to be a while then since Ludum dare a but I mean then we can also talk about kind of how we did can and have a little post-mortem chat that could be really fun so that's it for this livestream I'm sorry when totally off track and we did crazy stuff but I had a lot of fun I hope you did as well and of course I will see you soon with another video the video that comes out this Sunday is actually super awesome it's going to be about the full post-processing stack all the different image effects and also it the first sponsored video to come out on the breakage channel so I just wanted to let you guys know that that's the thing now I work together with skills here to create a sponsored video and that just means that we have an ad break in there it's not something huge I totally decided on the content myself and everything like that so just want to let you guys know that you should be prepared for that one definitely let me uh let me know when um when you see it and if there's anything I can do to improve that thing I don't normally do sponsored content and someone wanted me to say thanks for tuning in the break is thanks for tuning in at Preki and yeah awesome thanks for tuning in guys it was so much fun as always it's going to be up on the youtube channel it's going to be live here or available here on Twitch right after and thanks for watching if you want to get more of this sort of stuff you can go and support me over at patreon patreon comm slash brackets it really helps things going I keep things going and keep the lights on so that's awesome and on that thanks for watching and I will see you guys soon bye thanks to all the awesome patreon supporters who donated in April and a special thanks to Derek Hughes Kirk face will mattify James Callaghan Sybok Nami Coca brow and Jason the cheetah if you want to become a patron yourself you can do so a pinch ENCOM slash brettly
Info
Channel: Brackeys
Views: 407,871
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, beginner, easy, how, to, learn, tutorial, tutorials, game, development, develop, games, programming, coding, basic, basics, C#, live, strea, livestream, twitch, color, switch, replica, color switch, 2d, colour
Id: gE7gc1sblUA
Channel Id: undefined
Length: 81min 7sec (4867 seconds)
Published: Wed May 03 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.