If Visual Studio is not automatically suggesting code for Unity, please follow these steps: In Unity, go to Edit - Preferences. Under External Tools, pick Visual Studio from the "External Script Editor" dropdown. Then completely shut Visual Studio, and open it again by double clicking a script in Unity. It should now suggest code as you type!
I know you are probably mad busy so apologies in advance, but I tried both varients and even replaced the O with a 0 just in case it was a zero for some obscure reason, I think the problem may be that when I downloaded visual studio it wasn't the same as when you did it in your video, I think they might have changed something because visial studio isn't optional now and also where you said tick game development with unity, that option wasnt there at all, that screen didn't happen when installing at all for me, also neither was the tick box to get unity hub (I already have it so that's not so important), so yeah I think something has changed, probably not a massive deal if you are a seasoned game dev but I'm just starting out and i don't even know how to find the words to describe what I don't know aha, so thank you for being patient and helpful, and again sorry if this is at all vague, I'm trying to be as specific as possible
The script didn't change the birds name even when I type it exactly the same as you did, also there is a drop down menu as I type but with none of the things on it that yours show and as soon as I put a . on the end the list dissapears alltogether, again, apologies if you are super busy, I don't really know who to tak to, so maybe if you know of a good forum or somewhere I could research/ask?
Really great overview of the basics coupled with the usual excellent editing! Nice! Some more advanced concepts for anyone who wants to keep learning to the next level: - Naming Rules: They can be whatever you want, as long as you are consistent. Unity already uses PascalCase for functions so you should write your own functions with PascalCase as well in order to avoid Start, Update with one naming rule and custom functions with another. - Magic Numbers: Using numbers directly in the code can make it really tricky to remember what they mean when you return to the code after a few weeks. For example at 12:15, what does that "10" mean? As you are writing the code obviously you know what it means, but you will forget that meaning after some time. So instead of using magic numbers you should always give it a proper descriptive variable name. If you just use the value in that one place you can make it a local variable. You can see the huge difference with regards to code readability once Mark changes it to a variable, the code is much easier to understand. When you come back to that code 1 month from now there's no need to remember what "10" meant since it uses a proper variable name that clearly explains what it does. More info on Magic Numbers: th-cam.com/video/CQ5xHgRZGQo/w-d-xo.html - Making everything public: When you make something public you are allowing that field to be both read and written to from anywhere in your entire codebase. For example at 11:08 the Rigidbody is public but you don't want another random class to randomly modify that field. If you had another script that set that field to null while the game was running then everything would break. With the field set as public there is nothing to stop that from happening. So the better approach is to make it private, that way only that class can read and write to that field, no other class can modify it in any way. Good programming is all about minimizing complexity, the more you limit how accessible something is the easier it is to understand, you don't need to keep in mind your entire codebase since only the code in that class can read or write that field. So in that case you have two better options, you can make it private, but then you can't drag the reference in the inspector. Since the Rigidbody is on the same object you can grab the reference with GetComponent(); that's one approach. Another approach is make it private but add the attribute [SerializeField] this lets you make a field private so it's not accessible from any other class but it is accessible from the Unity editor. So with that you can drag the reference in the editor directly. More info on why you should NOT make everything public th-cam.com/video/pD27YuJG3L8/w-d-xo.html - Tags: They are strings and Strings are very error prone so you should really not use them, if you write "logic" instead of "Logic" it will break, if you write "Logic " it will break, "Iogic" "L0gic", etc. Just looking at it they all look correct and the code doesn't give off any errors, but when you run the game everything will break and it will cause you a lot of headaches. Instead of Tags either drag the reference directly or use the Singleton pattern. More on why you should avoid strings: th-cam.com/video/Q8n1uFTG97s/w-d-xo.html - Updating UI State: As I mentioned the main goal with good programming is minimizing complexity. In order to do that one of the best concepts is decoupling. You want your scripts to be as separated from everything else as possible, you want to limit interconnections as much as you can. So for example for updating the UI, 35:35 you should not have the Pipe Logic class tell the UI class what to do, that way the scripts are tightly coupled. If you remove the UI from the project everything will break because the Logic class expects the UI to exist. One excellent C# feature that really helps solve this are Events. This is how you can define an event, like OnPassedPipe which you could define on the Bird class, and then you fire that event whenever you want. Then some other class, like the UI class, can listen to that event and do whatever logic it wants, like updating the score text. That way the UI class would be completely decoupled from the Bird class. You could remove the UI and the code would still compile because they are not directly connected. Same thing for the GameOver logic, the Bird should fire off some kind of OnDead event which the GameOverScreen would listen to and show itself. Here's some more info on C# Events th-cam.com/video/OuZrhykVytg/w-d-xo.html - Text: Unity has two Text systems (which itself has two components for both UI and World) Mark mentioned it at 43:21 how the Text used in the video is the Legacy text which is extremely limited so nowadays you should instead use TextMeshPro In the code, instead of using UnityEngine.UI; you use using TMPro; For the field instead of Text you would use TextMeshProUGUI for UI Text and TextMeshPro for World text. - Input: With regards to Input, the new Input System is indeed much more capable but for learning and quickly making something using the legacy Input Manager is still an excellent option, it's what I use when I'm just making a prototype since it's very easy to use. If you want to learn more about the new Input System I covered it here th-cam.com/video/Yjee_e4fICc/w-d-xo.html - Render Pipelines: Mark quickly selected the 2D template and started making the game, this template uses what is called the Built-in Render Pipeline This is the render pipeline that Unity has had for years, it works great but nowadays you have two other options HDRP or the High Definition Render Pipeline which is the render pipeline you want to use if your game is pushing visuals to their limit. URP or the Universal Render Pipeline, this is the option you should probably be using nowadays, you have many more features like 2D lights, Shader Graph, etc. There are other Templates that you can download which come with the Render Pipeline already set up. In most cases nowadays you should be using URP, it's what I always use in my videos and its what I'm using in my upcoming Steam game Total World Liberation th-cam.com/video/6DGDWfPdn3w/w-d-xo.html - Unity Versions: In the beginning Mark downloaded the version that was automatically selected which is indeed the one you should be using, but if you search you might see some more versions, here's how they are organized. You have TECH, these are the more recent versions, right now it would be 2022.1, you should only use these when you have a specific feature you want to play around with that only exists in this version, or if you're making a game that is 1+ years away from release. ALPHA, BETA, as the name implies these are the upcoming versions and are not guaranteed to be extremely stable, so only use these when trying something on the bleeding edge. For 99% of cases you should use the version it automatically selects which is the LTS or Long Term Support version. So right now you should be using 2021.3 LTS, and in about 6 months you can use 2022.3 LTS More on Unity versions th-cam.com/video/LLYhTWEX2Wc/w-d-xo.html Great job with the video! I'm sure this will help tons of people on their game dev journey!
The Render Pipeline you will need will depend on what you want to do. For Android (mobile devices and Oculus Quest) URP performs worse than Built-In and visually for standalone VR it looks worse too. URP is only better for PC and console games so I don't agree that you should always use URP. All the other tips are really great and I actually learned some things I didn't know so thanks! It looks a bit spammy with the links, but still, thanks! 😅
@@martinofontana1275 Funnily enough, the “== true” is actually omitted at 13:52, so I’m guessing that portion was intended as more of a “teachable moment” about the difference between = and ==
I'm a school teacher that uses Unity for our game dev class. This is possibly the best introductory tutorial I have ever seen. All the fundamentals covered in a short, easy to understand manner that gives a learner a viable end product to show off, and ideas for further development and learning. Amazing work Mark. EDIT - 06/02/2023 - WIll be using this tutorial as part of a Unity introduction for my game dev class, will report back how the students go with it! EDIT 12/07/2023 Did a survey with the students at the end of course, asked about this video tutorial, here are the results Average rating out of 5 (rather unscientific question) - 4.13 What the students said: It was very fun and exciting to see a game which you coded work. Straight forward and helpful for clueless beginners. The tutorial is very clear and easy to follow Straight forward and very helpful. It was easy to listen to, no overcomplicated steps and enjoyable to do. thought I wasn't here for most bit, he could of have been more specific about certain settings and what we were meant to do (not shown in the video) Nice voice and good for beginners. Very organized and it a great transcendence Easy to understand and follow. Good experience to learn more about game programmings. It's detail and easy to understand I think its pace and information is good for beginners for their unfamiliarity with coding It was pretty good, the only thing that kind of threw me off was his strong accent. Excellent pacing which gave the time for you to work on it, and took the time to explain the purpose of each function straight forward and easy to understand and complete It very gud it was simple and good It was good for a starting tutorial for flappy bird. the tutorial was good, but there was a lot that had to be explained outside it. Should have more explaining on the code. It's long but it helps you understand a lot of stuff
I've been learning for 2 years now, but I still like to come back to videos like this take some pride in knowing I've passed all these hurdles. If you are reading this and just starting out, keep pushing forward and you will be rewarded in the future.
I watched this about 7 months ago and I've improved so much, I went from this to actually getting a steam page for one of my games, and I couldn't be more grateful for this tutorial, Ngl I be lost without it
yo can you help me. at exactly 3:10 a popup should happen right. The visual code community. It didnt happen to me and im on mac. Dyk how to access it another way. I need it so i can enable c++. Theres a button right beside "game development with unity" where it enables c++. PLease help
@@shababahmed9893 I've never encountered that problem. I don't know, But visual studio isn't the only way you can code in unity, It's probably just the most efficient way to do it. If I do find out how to fix it I'll let you know, Or maybe just try looking Online.
Honestly, this is what programming tutorials should be. A simple step-by-step video, split into chapters, and explained using recognizable visuals and representations. Keep up the amazing work!
You are an amazing educator. Being able to teach this much, in such a pedagogical way, in barely 40 minutes, is something worth admiring. Thank you for being you, ❤
I don't know if I'll ever use this tutorial but I really love how this channel has been getting into making games and helping other people with that journey as well
Honestly, for me at least, I’ve always tried to start making games, got into Godot and unity before but couldn’t ever figure it out. I’m in my third year of software engineering and still couldn’t grasp how to use the engines. Mark’s tutorial was a real blessing. I feel really confident that I actually learned something and that I can even make something of my own now! It was easy, fun and just overall a nice experience instead of those 20+ video series I used to watch with each episode having 30+ mins I’d say, give it a try. Especially if you have a programming background. But even if you don’t, this is still so nice
Great tutorial, very thorough and I learnt a lot from this! I did a few extra things on mine: - Added a gameover state if you hit the bottom of the screen with an empty 2D Box Collider - Main menu with start game and quit and also press escape in game to quit - Added support for left click and touch for mobiles - Added BG music and a stupid noise that plays when you game over Still need to figure out animations though! Other ideas - Record stupid voice over like old school unreal tournament in same voicing for things like "NICE WORK, 10 PASSES" - Increase height offset of the pipes factored from the score of multiples of 10 increasing it by a decimal making it more difficult and eventually impossible but no one is gonna get that far with my crappy game that only my friends will tell me im amazing for but I love a challenge UPDATE: - Added a screen wobble every time the player hits a score of multiple of 10 and the heightoffset increases by 0.3f Thank you GMT
This is hands down one of the best tutorials on anything, ever, that I have ever watched. It's clear, understandable, well paced, and after 18 years of programming in Adventure Game Studio, taught me new things not just about programming, but about how to think about programming. No exaggeration - it's been a rough few days for me. I suffer from severe depression and a lot of it is centered around creativity. I was preparing to give up on Unity entirely today, decided to try one more time to find a tutorial that wasn't confusing or that failed to work the way the creator said it did, and finally found yours. I've gone from wanting to cry to doing dances in my chair as I learned new things. I even accidentally broke something midway through and was able to figure out how to fix it using the things you taught me. THANK YOU. So much. I'm going to include a dedication to you and this tutorial in my first Unity game release.
I just want to say that you have a perfectly good and sane reason to be depressed with the state of the world as it is, you are not alone and it will get better with conceptual maturity.
quick tip: you probably don't want to set variables to public just to see them in the inspector (that creates a danger that you unintentionally change them somewhere else in the code). A much better practice is to prefix private variables you want to expose to the inspector with "[SerializeField]"
Definitely not, but for your first project it's probably fine. Most people learn this stuff later on in their development journey and apply them to more serious projects. At least that's how it was for me.
This is good practice yes, but as this is a tutorial for absolute beginners I don't think it's necessary to muddy the waters these kinds of instructions. Best to stick with the essentials imo
Yeah, this is general programming advice. The fewer place you're able to change variables in, the better it usually is. It's especially important if you're not the only one writing the code. It's about creating good habits, like writing reasonably clean code, commenting, and other things. It's not necessarily something you need to start with. I mean, you need to know how code works and what the difference between a public and a private variable is in the first place. But it's like step three or something in learning how to code. First you learn how to make things work at all on a very basic level, which is what this video is about. Second you learn more about what it is you're actually doing and what tools you have to pick from. Third is learning when to use what tools, such as public and private access modifiers, and how structure everything. You can incorporate the third into the first two parts, but that usually requires following tutorials more strictly or learning from actual teachers. Of course it's not the only way to learn things, but it's what I think works best.
Changing variables is for the weak and the indecisive! So are comments in code!! Once you set a variable you should commit to it like Kahless at the battle of Three Turn Bridge. Petaq!
As a gamedev myself, gotta say this is near perfection. Mark was able to compress hours of tutorials in a solid, nicely formatted, 40 minutes of pure and useful information. Got the perfect balance between just glimpsing all of Unity's potential and also presenting lots of content and quirks that only experienced people will get. My advice for those who want to get into this world would be to follow the steps as Mark describes them, side by side in your PC. That's the best way to actually learn. And as a few concepts he presented are a bit harder to get, would be a good idea to rewatch the video as you go in the learning process. That will show you how much you did evolve. As always, great video, Mark! Thank you!
@@sethezard6837 click "window" upscreen, and select "console". In this new window, will be shown useful information about your code, including bugs you have to fix before you can actually play the game. Also, search about debug. It will save ages of dev time in the future
See, this is what we need, tutorials that don't jump around the topic, that not only tell what to do but why you should do it and that uses comparisons to most people can understand. Truly one of the best tutorials out there
Just wanted to say after hours and hours of tutorials that never stuck, your 30-second description of what a game object is finally cemented how Unity works for me. Followed the video all the way through, opened a new project, and 3 hours later I had a simple prototype for my game jam game. Incredible stuff.
This is the greatest unity tutorial of all time. Actually kept my attention span, and I made a pretty neat platformer with just this. Most videos make me zone out within 2 minutes. Thank you for this. More videos like this please
bro I got half way through and keep getting some error that I don’t understand/ know how to fix. Spent the last 30 minutes trying to do either one but Idk what Im doing wrong. Guess teaching myself coding isn’t the move lol
@@meady50 if you can tell bit more precisely about the error, someone might be able to help. Eg what exactly do you try to do when error shows up? what does the error say? maybe share timestamp of that part from video? Even very experienced people get stuck with such issues once in a while😅, its a part of learning process.
@@meady50 i got errors as well, its because of a typo for me anyway lol im bad at typing and spelling.. that was first selling.. so.. ya.. or the ; at the end of the code program. make sure all things are spelled correctly and the little ; thing is there when needed
@@kevinkjellstrom7059 The ; symbol is a semicolon, which, in C#, is a statement terminator: in many programming languages, including C#, it indicates the end of a statement. And the C# files you were making are called _scripts._
I'm not kidding, this tutorial is straight up mind blowing. I'm a very slow learner and I always watched those TH-cam tutorials and I never completely understood what to do. This tutorial is just incredible! It really explain everything that can couse some doubt in a simple way! Thanks, bro! I'm finnaly making my game now
Jeez. I just burst out laughing. I added physics. You said the bird will fall down, but instead it floated up like a balloon. Turns out I added physics to my camera, and it fell off the stage,
I rarely give a comment on videos, but as a programmer (for about ~10 years) with no experience in game development yet, i must say: it was really nice to watch how you entered the challenge of rebuilding flappy bird. You just engineered the different requirements troughout the video, which is just what a programmer will do! Also, the hints on how to organize the code and so on where really on point! Great work!
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
I've been a software developer for years, and I've a background in theoretical physics and numerical simulations. One thing I'd always wanted to do was to write a simple gravitational simulation in 3D with graphics, and thanks to this I've finally done it. After going through your tutorial, I had a working simulation in about 30 minutes. Thank you so much Mark!
@@alextremayne4362 how in the world did you get unity to work whenever i try to open a project from the unity hub it just loads forever with no progress
This is probably the best Unity tutorial I have seen to date. I've been wanting to try game development for a while but could never get past the first few steps, so this has been immensely helpful. Great video!
One thing about this that I really didn't know I needed in a CS tutorial is that you do tiny steps and then show why we need to take extra ones. Like with the pipes spawning in every frame. This is amazing!
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
@@vt-bv4lw Be sure you have hit the period key ( . ) ofcourse, also be sure you are on a variabele with a type associated to it, if you type string and then period, does it give a lot of completions? sometimes you might also have to use the "using" statements that are on top of the file
I know I'm a bit late to this video, but please please make more unity tutorials. This is by far and away the best one I've come across nothing else comes close to matching the concise and yet in depth way you explain concepts. With other tutorials I feel like I am only learning the outermost surface of a concept with little to no ability to apply it elsewhere. This video was amazing and was edited so so well. We need more content like this
This is probably the best Unity tutorial I have seen to date. I've been wanting to try game development for a while but could never get past the first few steps, so this has been immensely helpful. Great video!
@@Rangeon I posted my comment partway through because it was already better than most tutorials I've seen. It still holds true after finishing (and I'm actually even more impressed now)
I've been programming a long time, and one of the toughest things when starting a new language is simply being overwhelmed by all of the syntax, components, libraries and broader ecosystem. Add to that a new GUI or IDE you need to learn and it only makes it harder. You've made this so simple to approach for creators of various skill levels. This is one of the best video tutorials I've ever seen. Great work, and thank you!
I had a near-identical experience to your first exposure to Unity. The mere understanding that "everything is a gameObject" and "gameObjects are containers for Components" was priceless! Thank you!
Thank you so much Mark. I watched this about 6 months ago and now I code games in Unity. I would have never started to make games. Recently I watched your videos about Mind over Magnet and I love how you present your work. It's amazing and I really appreciate that you helped me to build my own games.
I always "like" videos I watch the moment that I deem them to be really worth watching, and as a software developer with many years of experience and some experience dabbling in unity, this was so good, I went back to the youtube UI with the intention of liking it at least 4 times. This is a really amazing tutorial, and it's not only for people, beginners and otherwise, that hate tutorials. This is indeed, the definitive, first unity tutorial, that I wish existed when I first started using unity.
If anyone hits an error with 35:00 "logic = GameObject.FindGameObjectWithTag("Logic").GetComponent(); " be aware that Unity has both the singular "FindGameObjectWithTag" and the plural "FindGameObjectsWithTag" and the plural autopopulates above the singular (you'll see Mark has to press down 34:43 on the autofill results to select the 2nd option). If you wrote the plural on accident, it wont' autocomplete "GetComponent" and will show that as an error. Just delete that pesky "s" off Objects and you should be all set.
Dude, this is the kind of tutorial I wish existed when I started learning Unity years ago. You take things slow and your explanations are really clear. Definitely recommending this video to anyone who wants to learn Unity.
An addition to this fantastic tutorial: There are two different methods for initialization. *Awake* and *Start* Use *Awake* so the script can initialize its own values that are independent from other objects / scripts. Use *Start* so the script can get stuff from other components. Awake is called for all scripts first and then Start is called for all scripts. However, you *do not know the order* in which the scripts run. This can be an issue if you reference another object during initialization and that other object happens to not have called Start yet. I had some mean bugs because of it. Example: The car script has a name and a reference to tires. The tire script has a diameter. The car script sets a name during Initialization and collects the tires' diameters. The tire script sets a diameter value during initialization. Now, it *could* happen that the car asks the tires what their diameters are before they had actually done their setup and so the car has wrong values. To avoid that, Car.Awake sets the name, Tire.Awake sets the diameter and Car.Start gets the diameters from the tires. I wished I had known about that years ago.
@@Lugmillord imo it's kind of a hack - I certainly wouldn't go into a project intending to use it from the start - but it's the kind of thing that can be very useful to get you out of an otherwise tight spot
Very good tutorial 👍Here is an extra tidbit of information. Instead of destroying those pipes when they get off screen, turn them off and reuse them instead of creating new ones. This is called object pooling and it is much lighter than creating new ones. This is especially important if you are creating game with lots of objects like for example bulethell type of game.
but if you re-use them, won't they have the same Y position, in which case they won't be random anymore? Or you're supposed to adjust the script so it would rearrange pipes after taking them back to the right side of the screen?
This is one of the best Tutorial Structures i have ever seen, not just the content but the way you organize the topics and smoothly sequentially move from one to the next shows a level of hard work and craft mastery, well done!
I've "re-learned" Unity from the beginning many times over the past six years or so - partially as a refresher; partially as a form of procrastination. In any case, this is most clear and well-produced Unity crash course I've seen. As you put it, this is the tutorial I wish I'd had at the very beginning!
I've been dev-ing in Unity for about 5 years and I still found myself watching the entire video just because of how well composed it is. Good stuff Mark!
@@serbanandrei7532 Fairly well actually thanks! Recently got my first success with a game that got 300k downloads. Unfortunately it wasn't monetized but it's helped me build a bit of a following and learn a lot. Hoping to one day still go full time with game dev 🙂.
@@clarisrichter7966 hey, that is amazing! It give me a bit of hope. I just read earlier today that around 4000 apps are posted every day and the vast majority of them never get over 3 reviews. What is your game called?
@@lazizbekeminov2812 Hey. That could honestly be so many things but some common mistakes: If your console isn't showing any errors, it means that the collider isn't registering at all. Make sure that the hitbox is set up correctly, and also make sure that at least one of the objects involved in the collision has a rigidbody attached to it, otherwise the built-in unity OnCollisionEvent won't trigger. If you don't want the physics from the rigidbody (Like the gravity etc) but just want the collision logic, you can make the rigidbody "kinematic" in the inspector. Good luck!
This is an unbelievably good tutorial. The first 15 minutes alone provide such a clear, concise explanation of how unity’s structure and general workflow is organized. I’ve been a gmtk fan for a few years now, but this is probably the best video I’ve seen
Really excellent specifically for two reasons 1) Really great clear simple explanations that are sufficiently detailed but not too hard to grasp 2) Everything is legible. So many tutorials are difficult to follow because Unity editor text is really small and hard to see. You've made the text bigger which is common sense but most don't.
Dude, I also don't comment often on videos, but I came here to say thank you. I've watched a lot of game development tutorials, and they all convinced me that it's not for me. Thanks to you, I created my own first game, even though it's a clone of Flappy Bird. Now my daughter is playing it and having lots of fun, and I'm watching her enjoy it, feeling like a dream come true. Thank you.
As someone who isn't familiar with code, this process was not easy, but it's the first step. I'm excited to take this game, iterate on it, improve it and move on to cloning different games. I love this style of learning and I'm really excited to see how it all turns out. Thank you for the incredibly helpful tutorial! This was a great starting project where I felt like I understood why I was doing something instead of just mindlessly copying. I'll be referencing this video a lot, I'm sure!
The way you simplify concepts is so good. Calling a script a "custom component." The animation for components in a GameObject. These clear up so much for me, and I have a ton of non-game development experience.
This is the most comprehensive starter tutorial I've seen and it's exceptionally well made. The two aspects I like most are: 1) Very engaging: Every little step (in a nicely arranged flow) gives some kind of reward by making the program do something more. 2) Your visualization + explanation of for example the GameObject jar or the if gates are truly awesome. I wish I had such a comprehensive entry video. 3) Number 3 of 2: Good choice to use some legacy stuff. What good is it if you exhauste yourself to learn the new input system at the beginning, but your motivation drops because you don't make any visible progress.
As a uni student trying to learn the basics of Unity for complicated task for a research project I'm breaking into (based around game dev for education): THANK YOU! I have experience coding so some of this is very basic to me, but I can say this tutorial is excellent for beginners and more experienced programmers alike. Visual Studio is my favorite IDE that I've used so far, and I would say I'm very comfortable with it when working on .NET framework projects, but this video really helped bridge the gap on how the game engine interacts with VS as a script editor. I agree with almost everyone else in this comment section that this is one of the best coding tutorials I've ever seen. All of the analogies were beautiful, I wish more professors knew how to teach this well.
I have tried to learn unity on and off for YEARS and always given up because I reach a point where my own lack of fundamental understanding of the systems stops me from going any further. The way you described everything made so many light bulbs go off in my head . Please make more unity tutorials!!
I know you have other priorities (like working on your own game) but this is one of the best software tutorials I've seen. Great work! Would love to see more in this series and am looking forward to the next installment of Developing too.
As a game artist this is probably the best tutorial I ever seen, So many tutorials Skip explanations and you make them seamless and intuitive, great video. Thanks mark!
it still very hard and very hard to remember anything and hard to understand anything at all because its coding and that is litreally impossible if you haven't been coding ever since you were a little kid💀
I got stuck on the point system. It kept telling me the script was wrong. Even it showed no errors. I had to scrap all of it. I will try again tomorrow lol
@@mauricionapier He Even Mentioned The Issue In His Pinned Comment. I Wasnt Being Suggested The Codes. So I Had To Write Them Manually. And That Didnt Work Out Very Well.
@@Mirsano I have an idea for you, open the pipe prefab, and then go to the middle collision thing that he created, and in the box collider component, there is this little tick box called "IsTrigger", make sure this is enabled, something that I and many others forget, pretty annoying lol.
This is my first time programming so it was a little difficult but it’s so satisfying seeing the result after typing the code and pressing play in unity. Definitely a fun experience.
Thanks to this video, I finally understood how Start, Update, Void, and Public/Private code functions work. Its kinda confusing when I'm still learning it off in my classes.
I have some experiences in python, C, C# Illustrator and After effects and it feels good and makes me feel more confident to try this out because there are always parts which are similar. But never the less without such a good structured video and clear explanations I wouldn't came to this point of confidentness. Thanks for this video and your work. I really appreciate such guys like you which a just sharing knowledge for free! It's so valuable!!!
I cannot express how useful this video is! I am a game design student and the deadline for my project is in 10 days, but I feel like I haven't learned anything all year, because we've not had a lot of lectures, the lectures have been hard to follow, and I've been focusing on other subjects. This one video has really simple instructions that are easy to understand and follow for literally everything that I need, and I feel like I've learned more in the 46 minutes it took to watch it than I have for the whole school year since the end of August.
Nice! It's nice to see you pivot more and more towards game development in addition to your usual game design content. I've been a game developer for over 20 years and my TH-cam channel also caters to the gamedev (and Unity dev) niche, so it's nice to have you as company in this space :)
What's amazing is how you're going to bring this skill to a whole new generation of game devs. When I first started getting into your channel, you were just starting Boss Keys. In the time since I've almost completed an entire degree program in game development. Continue the great work.
Thank you for this. I had zero game dev or programming experience and I already feel like it's clicked after this one tutorial. For anyone who's working on the 'next steps', I'd like to share some of the things I did and how I did them: First, I realized there were a bunch of things I wanted to do when the game over screen shows. Aside from making it so that the user can no longer control the bird (which was covered in the tutorial), I wanted: - The pipes to stop spawning - The pipes that had already spawned to stop moving - The score to stop counting up if the bird accidentally fell through a middle pipe when the game was over Plus a few other things. To make this easier, I thought it would be smart to make a new bool in the logic script that I could reference from all the other scripts that needed to change. This bool would tell the other script whether or not the game over screen was active. So, I made a public bool in the Logic Script and called it gameIsOver. I set it as ==false as default at the top of the script. Then, in the existing gameOver function in the logic script, I added a line of code to change it to true (gameIsOver=true). This would make it so that gameIsOver = true when the gameover screen is active, and back to = false when the game is restarted. All I had to do then was set gameIsOver==false as an extra condition for the pipes to spawn in the PipeSpawnerScript, and as an extra condition for the pipes to move in the PipeMoveScript, and as an extra condition for the addScore function to run in the MiddleScript. This is relatively easy, but I won't tell you exactly how to do it so you can try yourself (hint: you need to use double ampersands '&&'). The cool thing about doing it this way is that you always have the gameIsOver bool to reference whenever you want to do something specifically when the GameOver screen is active, so it feels future proof. If anyone has any feedback or thinks I could have done this in a better way, let me know. I'm eager to learn :)
Hey, I'm trying to figure out how to stop the score to go up when the Bird die, and I hard your same idea. But when I try to make a new bool in the logicscript I can't make It as ==false (unity mark it as a syntax error: error CS1003). I've tryed to write public bool gameIsOver = false; but It seems not ti work the same. Can you help me on this one? P.s. Sorry for my poor english
This is by far THE BEST unity starter tutorial video I’ve found on TH-cam. The explanations and step-by-step walkthrough is exactly what I needed to get started with unity. I’d love to see you tackle making an RTS in unity!
Man, it took me about 8 hours of painstakingly sifting through code trying to find where I missed a comma or misspelled something; But as someone totally new to this world, I could never have gotten close to this by doing my own research. Cheers!
I've watched so many videos trying to learn Unity and code and this is by far the easiest to understand. The way you break down each element of the code is so helpful and no other videos I've found do this quite as well. Thankyou!
Honestly one of the best tutorials I have ever seen, you can tell you really understand what your talking about due to how simply your able to describe each step.
This has to be the best unity tutorial ever made. You explain everything with both words and visuals in ways that non programmers can still learn and understand. You should be very proud of your work :)
One of the best tutorials I've ever seen. It made me understand what each code does, how and why it works and of course, the basics of unity (2d, at least).
I feel pathetic admitting this, but as someone with severe ADHD and struggling with game dev, this video honestly made me cry. I understand it, I'm following it, and I'm focused on it (as well as I can be, anyway!). Thank you so much. I cannot believe this is free. You're helping so many people with the work you put into your videos.
Also, he doesn’t mention it, but it is best practice to write methods like: “ThisMethod”, as opposed to: “thismethod” or “thisMethod”. Variables are written like: “thisVar” as opposed to “thisvar” or “ThisVar”. Other than the fact that it makes it easier to read, it is just commonplace, so if you are just starting to code, simply use these “rules”.
Personally I wouldn't even worry about starting with adding in your own sprites at first. Unity has simple sprites prebuild in that you can use. (such as squares, circles, cubes, and plains) You can use something like the circle for the bird and a square for the pipes. After some rescaling to make the square into a rectangle ( and maybe changing the colors if you want) and you're ready to go! You can always switch out the sprite for your own later. I think it helps to learn to work with fewer resources and focus more on the design and feel of the game rather than looks. (Even the best looking game, if it doesn't play well, won't be to popular) It also teaches how to make placeholder sprites for when you want to add something in or start a new project without having to take the time to make a whole new set of sprites. For anyone wondering, you can add these into your game by right clicking in the hierarchy and going down to 2d objects > sprites, then clicking on the one you want to use. Then, to switch it out later, just click on the one you want to change and in the inspector scroll down to sprite renderer and then drag in the spite into the box next to the word "Sprite" (It should say whatever the shape you used by default) You may have to readjust some things but then you should be good to go!
i think that's how kirby was originally made too (or at least they used a similar concept)! they decided to just stick with their pink placeholder if i remember it correctly
Counterpoint: it can be very satisfying to make a game that looks AND feels good to play. It can make you feel more accomplished and like the project is more personal. If you have a strong aversion to developing artistic skills you can avoid it but i think any developer would benefit from giving it a try
@@Jack_______oh I agree, the game should look and feel nice, i’ve just experienced to many times where you get so bogged down with how the game looks that you never get to actually programming anything and you have files of assets that never get used, or when you go to use them they are scaled wrong or don’t animate well or end up clashing with how you designed a specific mechanic. For me, it’s just a lot easier to have placeholders first and then go in and make it look nice later
This is SO cool. If you play around with similar stuff then build and learn...you'll eventually be able to do. Don't doubt yourself. Keep learning and doing.
Thanks man! When I got the idea in my head to learn to make games this afternoon, I didn't think I'd have one finished in a couple of hours even if it was with a step-by-step guide and cloning an existing property! This was really helpful and now I feel confident that I can play around and get something more original to work. Appreciate the help.
I don't use unity, I bounced off of it and started my development journey on UE4, but this video and the basic knowledge I've learned through Unreal have really made me want to go back and give Unity a try. Thank you GMTk.
Man you are like the perfect teacher in TH-cam! I am an Unreal Engine user and I decided to use unity for my 2D games but was hesitant to do so... I saw this video now I am confident I can make any 2D game!
Absolutely amazing. I went from never before having used Unity to having my first game created in one morning. And I love that you ended the video encouraging us to expand on it and even try recreating other games. Really appreciated this content.
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
you genuinely have no idea how happy I am you've made this video. I've been saying to myself for so long that GMTK could make a unity tutorial that is actually helpful and ITS FINALLY HERE!!!
@GMTK This is the best tutorial I have ever seen on the internet. Your voice is pleasant, you are witty, patient and relaxed. Summing up each section really makes sense and gives the topic a nice closer. The animations and infographics are just beautiful and really deliver the message. As a programmer (~15 years) who rarely give comments, I can say that this was a refreshing experience for a wonderful technical explanation. Thank you for creating this!
Honestly even you might not be aware of it, but this tutorial is insanely good. not just for game development, but in any field where I tried to learn something new. You're a very good educator, you speak clearly and direct to the point. But also you know how to reach your audience and of course the editing helps a lot. This feels a lot like your friend explaining the school subject for you in 5 minutes. Like you know what our pain points are and you help us figure them out.
I've been struggling with getting into game development for the past couple of years, but this video has encompassed so much in such that I found incredibly helpful in such a short amount of time. Thank you so much for your attention to detail with the explanation!
@@SimuLord I am a game dev, I make revenue every month from my mobile games, I think like a game dev and build my own stuff. I never used Unity and I cannot write a single line of code. No need to be that complicated.
I've been a programmer in various fields for over 5 years now, and I think this video should be a prerequisite for a Unity class. Actually, it could even be part of any other class, really. I love how you kept it simple and yet left the doors wide open for exploration. Too many tutorials give everything to the student, and then after the lesson is over, no one learned anything on their own. Quite refreshing and impressive! Oh, and... VSCode > Visual Studio...... :D
Definitely disagree with Vscode > Visual Studio *for unity*, visual studio is just consistently better for unity with less errors and better debugging and intellisense
This is just such a fantastic tutorial, oozing pedagogical tact from start to finish. You can really tell that you’re someone whose had to learn this stuff, and has then thought very hard about what the best way to teach it would be
I made the painful mistake of adding a Box Collider instead of a Box Collider 2D to the middle of the pipe. Banged my head against the wall for too long. Won't make that mistake again! Thanks for the great tutorial, I learned a lot.
Oh my god, I had this issue. I couldn't for the life of me figure out why my score wasn't triggering. I wish TH-cam had a search function in the comments so I don't have to scroll through a hundred "nice video" comments to find helpful tips like this.
@@tacosauce935 have you figured it out? i moved on to the rest of the tutorial, completed, quadruple checked that all the code is the same and i still can't get the score to increase
@ed I don't know If you will have the same issue as me but make sure that you have you PIPEMOVESCRIPT attached to your MIDDLE PIPE prefab. This was my issue if it's not I might have a few more options left to tell you
Honestly man, I can't thank you enough! every single tutorial I've watched up until now were very confusing. I'm a visual learner, and not many videos (at least from what I've seen) do that.
This is probably the best intro for a game developer. The way you explain it is just amazing. Do the same but with UE. I think a lot watching your videos will appreciate it.
This tutorial has gotten me further than 20 hours of Unity videos otherwise. You are a king. I'm so glad you took this journey as it's enabling others to grow and experiment.
This is brilliantly perfect and exactly what I needed. It puts all everything together i needed to know, without covering the basics i knew. 10/10 no repetition, straight forward and extraordinarily explained
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
Love it! I watched some tutorials when I was going to try design a game last year, but all I really learned was to replicate what they made. I didn't have the patience (nor time) to do the 'playing around' I typically need to do to actually learn something. But this granular look with both setting it up and doing the stuff in the engine is really helpful! The modular approach feels more like learning what I'm doing instead of just doing something.
If you can't use LogicScript at about 33:35, It's because you named the previous script something else. He called the script "LogicScript" and then used that same name in visual studio. You gotta use the same name
As someone who has used Unity for nearly a decade, I obviously didn't get much from this (Though you reminded me that ContextMenu exists...), however this is definitely a great resource for those starting out. I have a few friends who have wanted to get into Unity and this video will now be among the resources I share with them. I've loved so far watching you progress with the engine. Maybe at some point it'd be interesting to see you try to learn the basics of other engines as well, though I'd recommend getting good in one engine over learning too many, any of the popular engines will work for most if not all games, and familiarity is far more important than feature sets the majority of the time. Some notes for those who want some additional pointers, these can mostly be ignored if you're just starting out and trying stuff out: 1) public variables are fine when starting out, however the fact that they can be accessed by other scripts can be an issue. You may down the line forget why a variable is public and attempt to modify it in the code which may mess things up. If the reason for the variable being public is solely for placing it in the inspector, you can make the field private and add [SerializeField] above it (with the brackets). This tells Unity to allow it to be serialized (serialization is the process of taking an object, turning it into some format that can be stored, and then turning that back into an object). The unity inspector is able to display serialized fields/variables. 2) In the timer example he showed off, in the event the timer is above it's max, nothing is added to the timer, this actually causes the timer to be ever so slightly off each time it spawns an object. The Time.deltaTime should be added to the timer regardless of whether it's above or below the threshold. Adding it before resetting it to 0 will effectively do nothing, so it's best to add the time to the timer after the if statement. This is only important if completely accurate time is what you're going for, for this it really doesn't matter. 3) When working in 2D you'll often have to use Vector3 a lot still, as shown in the video. It's worth noting however that a Vector3 can be constructed with only the x and y values provides like new Vector3(x, y), in which case the z is automatically considered 0. This is useful when dealing with a lot of Vector3's in a 2D game. It's also worth noting that a Vector2 will automatically be converted to a Vector3 when used in something that wants a Vector3, doing so is functionally identical to using Vector3 with only x and y, but be careful because this works the other way as well and can cause problems, a Vector3 can be converted to a Vector2, and unlike the other way around doing Vector3 -> Vector2 loses information as it drops the z value, something to be aware of. 4) I wouldn't worry about it when starting out, but in addition to the Update method there's also FixedUpdate. While Update is ran every frame, FixedUpdate is ran on a more fixed schedule. Most if not all physics calculations should be done in FixedUpdate instead of Update. It's worth noting that when in FixedUpdate you should use Time.fixedDeltaTime instead of Time.deltaTime. Input should never be handled in FixedUpdate as you may miss some input events, Inputs are processed each frame, but the fixed update can sometimes run multiple times a frame so dealing with inputs in it can be dangerous. Again for simple games you don't really have to worry about FixedUpdate, just note that it exists.
Actually to add onto point #2 instead of setting the timer to 0 when the threshold is met, it's actually better to subtract the threshold from the timer value, so if one frame it was 0.995 and the next frame it's 1.015, and the threshold is 1 as an example, the timer would be set to 0.015, Because this frame was 0.015 of the threshold late, the next one will run approximately 0.015 sooner. This will actually keep the timer completely on schedule without drifting.
For people who are not getting the auto complete and Intellisense and Unity - VS attachment in general, try to go to preferences>external tools and reload the project files. If the Solution Manager in VS says Assembly-CSharp incompatible, right click on it and select reload with additional components or something similar to it. It must reload all the assemblies. Try reloading the project files again after that. Have fun making games!
@@eladkatzir7855 for me i just did it like this, in unity after you open a project go to Edit > Preferences > External Tools, and then for the first section "External Script Editor" select the microsoft visual studio one instead of just nothing and that might fix it.
If Visual Studio is not automatically suggesting code for Unity, please follow these steps:
In Unity, go to Edit - Preferences.
Under External Tools, pick Visual Studio from the "External Script Editor" dropdown.
Then completely shut Visual Studio, and open it again by double clicking a script in Unity.
It should now suggest code as you type!
I will try this now, thank you :)
I know you are probably mad busy so apologies in advance, but I tried both varients and even replaced the O with a 0 just in case it was a zero for some obscure reason, I think the problem may be that when I downloaded visual studio it wasn't the same as when you did it in your video, I think they might have changed something because visial studio isn't optional now and also where you said tick game development with unity, that option wasnt there at all, that screen didn't happen when installing at all for me, also neither was the tick box to get unity hub (I already have it so that's not so important), so yeah I think something has changed, probably not a massive deal if you are a seasoned game dev but I'm just starting out and i don't even know how to find the words to describe what I don't know aha, so thank you for being patient and helpful, and again sorry if this is at all vague, I'm trying to be as specific as possible
The script didn't change the birds name even when I type it exactly the same as you did, also there is a drop down menu as I type but with none of the things on it that yours show and as soon as I put a . on the end the list dissapears alltogether, again, apologies if you are super busy, I don't really know who to tak to, so maybe if you know of a good forum or somewhere I could research/ask?
I really wish there was such a tutorial for adobe premiere or whatever you use for making your videos
The 3rd will show error if you do gameObject.FindGameObjectWithTag and not GameObject.FindGameObjectWithTag
GameObject with capital G
Really great overview of the basics coupled with the usual excellent editing! Nice!
Some more advanced concepts for anyone who wants to keep learning to the next level:
- Naming Rules: They can be whatever you want, as long as you are consistent. Unity already uses PascalCase for functions so you should write your own functions with PascalCase as well in order to avoid Start, Update with one naming rule and custom functions with another.
- Magic Numbers: Using numbers directly in the code can make it really tricky to remember what they mean when you return to the code after a few weeks.
For example at 12:15, what does that "10" mean? As you are writing the code obviously you know what it means, but you will forget that meaning after some time. So instead of using magic numbers you should always give it a proper descriptive variable name. If you just use the value in that one place you can make it a local variable.
You can see the huge difference with regards to code readability once Mark changes it to a variable, the code is much easier to understand. When you come back to that code 1 month from now there's no need to remember what "10" meant since it uses a proper variable name that clearly explains what it does.
More info on Magic Numbers: th-cam.com/video/CQ5xHgRZGQo/w-d-xo.html
- Making everything public: When you make something public you are allowing that field to be both read and written to from anywhere in your entire codebase.
For example at 11:08 the Rigidbody is public but you don't want another random class to randomly modify that field. If you had another script that set that field to null while the game was running then everything would break. With the field set as public there is nothing to stop that from happening.
So the better approach is to make it private, that way only that class can read and write to that field, no other class can modify it in any way. Good programming is all about minimizing complexity, the more you limit how accessible something is the easier it is to understand, you don't need to keep in mind your entire codebase since only the code in that class can read or write that field.
So in that case you have two better options, you can make it private, but then you can't drag the reference in the inspector. Since the Rigidbody is on the same object you can grab the reference with GetComponent(); that's one approach.
Another approach is make it private but add the attribute [SerializeField] this lets you make a field private so it's not accessible from any other class but it is accessible from the Unity editor. So with that you can drag the reference in the editor directly.
More info on why you should NOT make everything public th-cam.com/video/pD27YuJG3L8/w-d-xo.html
- Tags: They are strings and Strings are very error prone so you should really not use them, if you write "logic" instead of "Logic" it will break, if you write "Logic " it will break, "Iogic" "L0gic", etc. Just looking at it they all look correct and the code doesn't give off any errors, but when you run the game everything will break and it will cause you a lot of headaches. Instead of Tags either drag the reference directly or use the Singleton pattern.
More on why you should avoid strings: th-cam.com/video/Q8n1uFTG97s/w-d-xo.html
- Updating UI State: As I mentioned the main goal with good programming is minimizing complexity. In order to do that one of the best concepts is decoupling. You want your scripts to be as separated from everything else as possible, you want to limit interconnections as much as you can.
So for example for updating the UI, 35:35 you should not have the Pipe Logic class tell the UI class what to do, that way the scripts are tightly coupled. If you remove the UI from the project everything will break because the Logic class expects the UI to exist.
One excellent C# feature that really helps solve this are Events. This is how you can define an event, like OnPassedPipe which you could define on the Bird class, and then you fire that event whenever you want. Then some other class, like the UI class, can listen to that event and do whatever logic it wants, like updating the score text.
That way the UI class would be completely decoupled from the Bird class. You could remove the UI and the code would still compile because they are not directly connected.
Same thing for the GameOver logic, the Bird should fire off some kind of OnDead event which the GameOverScreen would listen to and show itself.
Here's some more info on C# Events th-cam.com/video/OuZrhykVytg/w-d-xo.html
- Text: Unity has two Text systems (which itself has two components for both UI and World)
Mark mentioned it at 43:21 how the Text used in the video is the Legacy text which is extremely limited so nowadays you should instead use TextMeshPro
In the code, instead of using UnityEngine.UI; you use using TMPro;
For the field instead of Text you would use TextMeshProUGUI for UI Text and TextMeshPro for World text.
- Input: With regards to Input, the new Input System is indeed much more capable but for learning and quickly making something using the legacy Input Manager is still an excellent option, it's what I use when I'm just making a prototype since it's very easy to use.
If you want to learn more about the new Input System I covered it here th-cam.com/video/Yjee_e4fICc/w-d-xo.html
- Render Pipelines: Mark quickly selected the 2D template and started making the game, this template uses what is called the Built-in Render Pipeline
This is the render pipeline that Unity has had for years, it works great but nowadays you have two other options
HDRP or the High Definition Render Pipeline which is the render pipeline you want to use if your game is pushing visuals to their limit.
URP or the Universal Render Pipeline, this is the option you should probably be using nowadays, you have many more features like 2D lights, Shader Graph, etc.
There are other Templates that you can download which come with the Render Pipeline already set up.
In most cases nowadays you should be using URP, it's what I always use in my videos and its what I'm using in my upcoming Steam game Total World Liberation th-cam.com/video/6DGDWfPdn3w/w-d-xo.html
- Unity Versions: In the beginning Mark downloaded the version that was automatically selected which is indeed the one you should be using, but if you search you might see some more versions, here's how they are organized.
You have TECH, these are the more recent versions, right now it would be 2022.1, you should only use these when you have a specific feature you want to play around with that only exists in this version, or if you're making a game that is 1+ years away from release.
ALPHA, BETA, as the name implies these are the upcoming versions and are not guaranteed to be extremely stable, so only use these when trying something on the bleeding edge.
For 99% of cases you should use the version it automatically selects which is the LTS or Long Term Support version. So right now you should be using 2021.3 LTS, and in about 6 months you can use 2022.3 LTS
More on Unity versions th-cam.com/video/LLYhTWEX2Wc/w-d-xo.html
Great job with the video! I'm sure this will help tons of people on their game dev journey!
This should be pinned!
The Render Pipeline you will need will depend on what you want to do. For Android (mobile devices and Oculus Quest) URP performs worse than Built-In and visually for standalone VR it looks worse too. URP is only better for PC and console games so I don't agree that you should always use URP.
All the other tips are really great and I actually learned some things I didn't know so thanks!
It looks a bit spammy with the links, but still, thanks! 😅
Thanks for the extra info, I'm sure other Unity beginners like me appreciate it just like I do
@@austinh1242 Yup. Greatly appreciate the information.
@@martinofontana1275 Funnily enough, the “== true” is actually omitted at 13:52, so I’m guessing that portion was intended as more of a “teachable moment” about the difference between = and ==
I'm a school teacher that uses Unity for our game dev class. This is possibly the best introductory tutorial I have ever seen. All the fundamentals covered in a short, easy to understand manner that gives a learner a viable end product to show off, and ideas for further development and learning. Amazing work Mark.
EDIT - 06/02/2023 - WIll be using this tutorial as part of a Unity introduction for my game dev class, will report back how the students go with it!
EDIT 12/07/2023
Did a survey with the students at the end of course, asked about this video tutorial, here are the results
Average rating out of 5 (rather unscientific question) - 4.13
What the students said:
It was very fun and exciting to see a game which you coded work.
Straight forward and helpful for clueless beginners.
The tutorial is very clear and easy to follow
Straight forward and very helpful.
It was easy to listen to, no overcomplicated steps and enjoyable to do.
thought I wasn't here for most bit, he could of have been more specific about certain settings and what we were meant to do (not shown in the video)
Nice voice and good for beginners.
Very organized and it a great transcendence
Easy to understand and follow.
Good experience to learn more about game programmings.
It's detail and easy to understand
I think its pace and information is good for beginners for their unfamiliarity with coding
It was pretty good, the only thing that kind of threw me off was his strong accent.
Excellent pacing which gave the time for you to work on it, and took the time to explain the purpose of each function
straight forward and easy to understand and complete
It very gud
it was simple and good
It was good for a starting tutorial for flappy bird.
the tutorial was good, but there was a lot that had to be explained outside it.
Should have more explaining on the code.
It's long but it helps you understand a lot of stuff
Which school?
@@alex.g7317 a school in Melbourne, Australia
I wish there was game dev classes when i was in school. Had to self learn like a chump :/
hi Mr Cooper
@@fyx8248 💀
I've been learning for 2 years now, but I still like to come back to videos like this take some pride in knowing I've passed all these hurdles. If you are reading this and just starting out, keep pushing forward and you will be rewarded in the future.
Five minutes in and already 4 errors
@@noninterestingname334 lol just wait until you write a line of code that crashes the editor on play. That's how you really know you made it.
@@kristianthaler6525 you gave me the motivation to keep on coding and creating THANK YOU
how can i increase the speed of the game as score goes high. i tried following tutorials but they are too complicated(for noob like me )
@@kristianthaler6525 Bro if your are learning for 2 yr then now what are u doing like job, freelancing or anything else
I watched this about 7 months ago and I've improved so much, I went from this to actually getting a steam page for one of my games, and I couldn't be more grateful for this tutorial, Ngl I be lost without it
yo can you help me. at exactly 3:10 a popup should happen right. The visual code community. It didnt happen to me and im on mac. Dyk how to access it another way. I need it so i can enable c++. Theres a button right beside "game development with unity" where it enables c++. PLease help
@@shababahmed9893 I've never encountered that problem. I don't know, But visual studio isn't the only way you can code in unity, It's probably just the most efficient way to do it. If I do find out how to fix it I'll let you know, Or maybe just try looking Online.
What is the name of your game?
@@SupMonkey Twisted Screens
@@bonboipluh looks pretty decent
Honestly, this is what programming tutorials should be. A simple step-by-step video, split into chapters, and explained using recognizable visuals and representations. Keep up the amazing work!
its the words he used that made it all make sense. Its more than visuals and structure. He understands quality :)
Definitely top tier. I had to subscribe
You are an amazing educator. Being able to teach this much, in such a pedagogical way, in barely 40 minutes, is something worth admiring. Thank you for being you, ❤
I don't know if I'll ever use this tutorial but I really love how this channel has been getting into making games and helping other people with that journey as well
I clicked on this thinking I wouldn't get back into game dev, but now I'm inspired lol. Might try and drag some friends in with me this time around!
Honestly, for me at least, I’ve always tried to start making games, got into Godot and unity before but couldn’t ever figure it out. I’m in my third year of software engineering and still couldn’t grasp how to use the engines. Mark’s tutorial was a real blessing. I feel really confident that I actually learned something and that I can even make something of my own now! It was easy, fun and just overall a nice experience instead of those 20+ video series I used to watch with each episode having 30+ mins
I’d say, give it a try. Especially if you have a programming background. But even if you don’t, this is still so nice
Great tutorial, very thorough and I learnt a lot from this! I did a few extra things on mine:
- Added a gameover state if you hit the bottom of the screen with an empty 2D Box Collider
- Main menu with start game and quit and also press escape in game to quit
- Added support for left click and touch for mobiles
- Added BG music and a stupid noise that plays when you game over
Still need to figure out animations though!
Other ideas
- Record stupid voice over like old school unreal tournament in same voicing for things like "NICE WORK, 10 PASSES"
- Increase height offset of the pipes factored from the score of multiples of 10 increasing it by a decimal making it more difficult and eventually impossible but no one is gonna get that far with my crappy game that only my friends will tell me im amazing for but I love a challenge
UPDATE:
- Added a screen wobble every time the player hits a score of multiple of 10 and the heightoffset increases by 0.3f
Thank you GMT
What code did you use to get the touch functionality for mobile?
@@Kallamadama I think that left click works the same as touch. sorry for late reply
@@armordillo87 Yeah it does, i added the mouse left click along with the space bar for a flap, but when i exported it to an APK file, it worked! nice
This is hands down one of the best tutorials on anything, ever, that I have ever watched. It's clear, understandable, well paced, and after 18 years of programming in Adventure Game Studio, taught me new things not just about programming, but about how to think about programming.
No exaggeration - it's been a rough few days for me. I suffer from severe depression and a lot of it is centered around creativity. I was preparing to give up on Unity entirely today, decided to try one more time to find a tutorial that wasn't confusing or that failed to work the way the creator said it did, and finally found yours. I've gone from wanting to cry to doing dances in my chair as I learned new things. I even accidentally broke something midway through and was able to figure out how to fix it using the things you taught me.
THANK YOU. So much. I'm going to include a dedication to you and this tutorial in my first Unity game release.
Much agreed, and good luck yo! Same here >;D
I just want to say that you have a perfectly good and sane reason to be depressed with the state of the world as it is, you are not alone and it will get better with conceptual maturity.
Thank you for this comment, really encourages me to watch the video :) good luck
we out here bro thanks for sharing
i feel you bro
quick tip:
you probably don't want to set variables to public just to see them in the inspector (that creates a danger that you unintentionally change them somewhere else in the code). A much better practice is to prefix private variables you want to expose to the inspector with "[SerializeField]"
Yes. This is also something I wish I knew years ago... Inspector management is so important.
Definitely not, but for your first project it's probably fine. Most people learn this stuff later on in their development journey and apply them to more serious projects. At least that's how it was for me.
This is good practice yes, but as this is a tutorial for absolute beginners I don't think it's necessary to muddy the waters these kinds of instructions. Best to stick with the essentials imo
Yeah, this is general programming advice. The fewer place you're able to change variables in, the better it usually is. It's especially important if you're not the only one writing the code.
It's about creating good habits, like writing reasonably clean code, commenting, and other things. It's not necessarily something you need to start with. I mean, you need to know how code works and what the difference between a public and a private variable is in the first place.
But it's like step three or something in learning how to code. First you learn how to make things work at all on a very basic level, which is what this video is about. Second you learn more about what it is you're actually doing and what tools you have to pick from. Third is learning when to use what tools, such as public and private access modifiers, and how structure everything. You can incorporate the third into the first two parts, but that usually requires following tutorials more strictly or learning from actual teachers.
Of course it's not the only way to learn things, but it's what I think works best.
Changing variables is for the weak and the indecisive! So are comments in code!! Once you set a variable you should commit to it like Kahless at the battle of Three Turn Bridge.
Petaq!
As a gamedev myself, gotta say this is near perfection. Mark was able to compress hours of tutorials in a solid, nicely formatted, 40 minutes of pure and useful information. Got the perfect balance between just glimpsing all of Unity's potential and also presenting lots of content and quirks that only experienced people will get. My advice for those who want to get into this world would be to follow the steps as Mark describes them, side by side in your PC. That's the best way to actually learn. And as a few concepts he presented are a bit harder to get, would be a good idea to rewatch the video as you go in the learning process. That will show you how much you did evolve.
As always, great video, Mark! Thank you!
I need help, it says ‘ all complier errors have to be fixed before you can enter play mode!
@@sethezard6837 click "window" upscreen, and select "console". In this new window, will be shown useful information about your code, including bugs you have to fix before you can actually play the game. Also, search about debug. It will save ages of dev time in the future
Offtopic
But can I ask you from where your profile pic comes?
@@KitsuneFaroe like the foxes huh? Me too lol
This one is a built in pic in google account. When creating mine, this pic did catch my eyes.
@@lucasfogaca555 oh didn't knew there were built-in pics in Google! Forgot about that. And thanks!.
Foxes are just the best!
Never expected I'd have a Playable game made by my hands on my computer. This was awesome. Thx
See, this is what we need, tutorials that don't jump around the topic, that not only tell what to do but why you should do it and that uses comparisons to most people can understand. Truly one of the best tutorials out there
it isnt letting me import an asset im pressing import nothing hppened
@@stuntfax9004 tell the creator of the video not him
Just wanted to say after hours and hours of tutorials that never stuck, your 30-second description of what a game object is finally cemented how Unity works for me. Followed the video all the way through, opened a new project, and 3 hours later I had a simple prototype for my game jam game. Incredible stuff.
🎉congrats!
Niceee, Id also describe a game object as a blank png which you can put anything onto.
it isnt letting me import an asset im pressing import nothing hppened
Didn’t you make a game and show it on TikTok?
drag n drop@@stuntfax9004
This is the greatest unity tutorial of all time. Actually kept my attention span, and I made a pretty neat platformer with just this. Most videos make me zone out within 2 minutes. Thank you for this.
More videos like this please
bro I got half way through and keep getting some error that I don’t understand/ know how to fix. Spent the last 30 minutes trying to do either one but Idk what Im doing wrong. Guess teaching myself coding isn’t the move lol
@@meady50 if you can tell bit more precisely about the error, someone might be able to help. Eg what exactly do you try to do when error shows up? what does the error say? maybe share timestamp of that part from video?
Even very experienced people get stuck with such issues once in a while😅, its a part of learning process.
@@meady50 i got errors as well, its because of a typo for me anyway lol im bad at typing and spelling.. that was first selling.. so.. ya.. or the ; at the end of the code program. make sure all things are spelled correctly and the little ; thing is there when needed
@@chetan9533 sorry this is a year late, but I ended up just re starting the entire thing from scratch and it happened to work the second time
@@kevinkjellstrom7059 The ; symbol is a semicolon, which, in C#, is a statement terminator: in many programming languages, including C#, it indicates the end of a statement. And the C# files you were making are called _scripts._
I'm not kidding, this tutorial is straight up mind blowing. I'm a very slow learner and I always watched those TH-cam tutorials and I never completely understood what to do. This tutorial is just incredible! It really explain everything that can couse some doubt in a simple way! Thanks, bro! I'm finnaly making my game now
Jeez. I just burst out laughing. I added physics. You said the bird will fall down, but instead it floated up like a balloon. Turns out I added physics to my camera, and it fell off the stage,
🤣
😂😂😂😂
XDDD
XXDXD im ded
OMG I did the same thing and was scratching my head for about 20 minutes before I saw you message lol
I rarely give a comment on videos, but as a programmer (for about ~10 years) with no experience in game development yet, i must say: it was really nice to watch how you entered the challenge of rebuilding flappy bird. You just engineered the different requirements troughout the video, which is just what a programmer will do! Also, the hints on how to organize the code and so on where really on point! Great work!
+1 to this, exactly the same feeling. Well said.
@@HookedupJoe it isnt letting me import an asset im pressing import nothing hppened
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
@@vt-bv4lw
Fix Visual Studio Autocomplete/Intellisense in Unity - (2022, 2019, 2017)
> You just engineered the different requirements troughout the video, which is just what a programmer will do!
But that's not a good thing.
I've been a software developer for years, and I've a background in theoretical physics and numerical simulations. One thing I'd always wanted to do was to write a simple gravitational simulation in 3D with graphics, and thanks to this I've finally done it. After going through your tutorial, I had a working simulation in about 30 minutes.
Thank you so much Mark!
goddamn bro really just said hold my dark matter
Do you know how that ide works than? Can I ask you a potentially dumb question? I need help 😭 Lol
@@It-is-PhillipFrank Hi sorry for the late reply,
Feel free to ask, but I can't promise anything. I haven't touched VS in ages now
@@alextremayne4362 how in the world did you get unity to work whenever i try to open a project from the unity hub it just loads forever with no progress
This is probably the best Unity tutorial I have seen to date. I've been wanting to try game development for a while but could never get past the first few steps, so this has been immensely helpful. Great video!
One thing about this that I really didn't know I needed in a CS tutorial is that you do tiny steps and then show why we need to take extra ones. Like with the pipes spawning in every frame. This is amazing!
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
@@vt-bv4lw Be sure you have hit the period key ( . ) ofcourse, also be sure you are on a variabele with a type associated to it, if you type string and then period, does it give a lot of completions? sometimes you might also have to use the "using" statements that are on top of the file
@@Birb- In the end I succeeded, I just had to change something small in the settings, thanks a lot anyway
I know I'm a bit late to this video, but please please make more unity tutorials. This is by far and away the best one I've come across nothing else comes close to matching the concise and yet in depth way you explain concepts. With other tutorials I feel like I am only learning the outermost surface of a concept with little to no ability to apply it elsewhere. This video was amazing and was edited so so well. We need more content like this
yes please make more tutorial videos like this
oh hell yea. You couldnt describe it better. This video is amazing and helped a ton!
Hell yes, more Unity tutorials like this would be great!
it isnt letting me import an asset im pressing import nothing hppened
@@stuntfax9004 i think you have to hit the "import new asset" option
This is probably the best Unity tutorial I have seen to date. I've been wanting to try game development for a while but could never get past the first few steps, so this has been immensely helpful. Great video!
and you heven't watched it
@@Rangeon I posted my comment partway through because it was already better than most tutorials I've seen. It still holds true after finishing (and I'm actually even more impressed now)
@@austinh1242 okie sorry
@@Rangeon you don't have to apologize lol you're totally fine
it isnt letting me import an asset im pressing import nothing hppened
For anyone wondering , velocity is now replaced with Linear Velocity , because it isn't supported anymore by unity.
velocity worked for me
@@LsdRaccoon maybe you have an older version of unity or visual studio
@@AchMart so what do i do?
@@IVAN-pz6et instead instead of putting:myRigidbody.velocity you put myRigidbody.linearvelocity
@@IVAN-pz6et instead of puting myRigidbody.velocity.... you put myRigidbody.linear.velocity
I've been programming a long time, and one of the toughest things when starting a new language is simply being overwhelmed by all of the syntax, components, libraries and broader ecosystem. Add to that a new GUI or IDE you need to learn and it only makes it harder. You've made this so simple to approach for creators of various skill levels. This is one of the best video tutorials I've ever seen. Great work, and thank you!
i only know python lol but not i need to learn c#
After finishing this tutorial, I am now confident to make the next Souls Game.
Go fourth and become Elden- EHEM** Unity Lord!!!
I had a near-identical experience to your first exposure to Unity. The mere understanding that "everything is a gameObject" and "gameObjects are containers for Components" was priceless! Thank you!
it isnt letting me import an asset im pressing import nothing hppened
I now know why people recommended this video for starting the Unity/coding journey...absolutely brilliant explanations. Thanks for this.
Thank you so much Mark. I watched this about 6 months ago and now I code games in Unity. I would have never started to make games. Recently I watched your videos about Mind over Magnet and I love how you present your work. It's amazing and I really appreciate that you helped me to build my own games.
I always "like" videos I watch the moment that I deem them to be really worth watching, and as a software developer with many years of experience and some experience dabbling in unity, this was so good, I went back to the youtube UI with the intention of liking it at least 4 times. This is a really amazing tutorial, and it's not only for people, beginners and otherwise, that hate tutorials. This is indeed, the definitive, first unity tutorial, that I wish existed when I first started using unity.
If anyone hits an error with 35:00 "logic = GameObject.FindGameObjectWithTag("Logic").GetComponent(); " be aware that Unity has both the singular "FindGameObjectWithTag" and the plural "FindGameObjectsWithTag" and the plural autopopulates above the singular (you'll see Mark has to press down 34:43 on the autofill results to select the 2nd option). If you wrote the plural on accident, it wont' autocomplete "GetComponent" and will show that as an error. Just delete that pesky "s" off Objects and you should be all set.
I was facing this error, but to my surprise it still shows an error after fixing this. what am i doing wrong?
Nevermind, I forgot to save my code :]
Mine is not appearing on the autocomplete at all?
@@smokysnow5794 and you have your preferences set to make VC the 3rd party editor?
@@hwkeyser i fixed it nvm
Dude, this is the kind of tutorial I wish existed when I started learning Unity years ago. You take things slow and your explanations are really clear. Definitely recommending this video to anyone who wants to learn Unity.
An addition to this fantastic tutorial:
There are two different methods for initialization. *Awake* and *Start*
Use *Awake* so the script can initialize its own values that are independent from other objects / scripts. Use *Start* so the script can get stuff from other components.
Awake is called for all scripts first and then Start is called for all scripts. However, you *do not know the order* in which the scripts run. This can be an issue if you reference another object during initialization and that other object happens to not have called Start yet. I had some mean bugs because of it.
Example:
The car script has a name and a reference to tires. The tire script has a diameter.
The car script sets a name during Initialization and collects the tires' diameters. The tire script sets a diameter value during initialization. Now, it *could* happen that the car asks the tires what their diameters are before they had actually done their setup and so the car has wrong values. To avoid that, Car.Awake sets the name, Tire.Awake sets the diameter and Car.Start gets the diameters from the tires.
I wished I had known about that years ago.
If you really have to there's also an option to force a certain execution order between scripts (in Script Execution Order in project settings).
@@sammoore2242 you can? interesting.
@@Lugmillord imo it's kind of a hack - I certainly wouldn't go into a project intending to use it from the start - but it's the kind of thing that can be very useful to get you out of an otherwise tight spot
@@sammoore2242 Before I knew about Awake vs Start, I did other ugly workarounds like starting a coroutine that waits for one frame.
what about, ERECT
TH-cam gods decided that I shall watch this, who am I a mere mortal to judge their decision.
All bow before the TH-cam algorithm
Best comment!!
I actually am trying to learn Unity and then he makes this. Perfect timing!
Get that notification 😤
It knew what u are destined to do🫡
Very good tutorial 👍Here is an extra tidbit of information. Instead of destroying those pipes when they get off screen, turn them off and reuse them instead of creating new ones. This is called object pooling and it is much lighter than creating new ones. This is especially important if you are creating game with lots of objects like for example bulethell type of game.
Good tip!
but if you re-use them, won't they have the same Y position, in which case they won't be random anymore? Or you're supposed to adjust the script so it would rearrange pipes after taking them back to the right side of the screen?
@@justpassing2533 I'm not sure if would have that problem
@@justpassing2533 You can just move them back to the right and randomize the Y again with 2 lines of code
This is one of the best Tutorial Structures i have ever seen, not just the content but the way you organize the topics and smoothly sequentially move from one to the next shows a level of hard work and craft mastery, well done!
I've "re-learned" Unity from the beginning many times over the past six years or so - partially as a refresher; partially as a form of procrastination. In any case, this is most clear and well-produced Unity crash course I've seen. As you put it, this is the tutorial I wish I'd had at the very beginning!
I've been dev-ing in Unity for about 5 years and I still found myself watching the entire video just because of how well composed it is. Good stuff Mark!
How is your game dev career going
@@serbanandrei7532 Fairly well actually thanks! Recently got my first success with a game that got 300k downloads. Unfortunately it wasn't monetized but it's helped me build a bit of a following and learn a lot. Hoping to one day still go full time with game dev 🙂.
@@clarisrichter7966 hey, that is amazing! It give me a bit of hope. I just read earlier today that around 4000 apps are posted every day and the vast majority of them never get over 3 reviews. What is your game called?
Hello, the score of the game isn't increasing ( stays 0) , what should I do? Please can you help?
@@lazizbekeminov2812 Hey. That could honestly be so many things but some common mistakes:
If your console isn't showing any errors, it means that the collider isn't registering at all. Make sure that the hitbox is set up correctly, and also make sure that at least one of the objects involved in the collision has a rigidbody attached to it, otherwise the built-in unity OnCollisionEvent won't trigger. If you don't want the physics from the rigidbody (Like the gravity etc) but just want the collision logic, you can make the rigidbody "kinematic" in the inspector. Good luck!
This is an unbelievably good tutorial. The first 15 minutes alone provide such a clear, concise explanation of how unity’s structure and general workflow is organized.
I’ve been a gmtk fan for a few years now, but this is probably the best video I’ve seen
Really excellent specifically for two reasons
1) Really great clear simple explanations that are sufficiently detailed but not too hard to grasp
2) Everything is legible. So many tutorials are difficult to follow because Unity editor text is really small and hard to see. You've made the text bigger which is common sense but most don't.
Dude, I also don't comment often on videos, but I came here to say thank you. I've watched a lot of game development tutorials, and they all convinced me that it's not for me. Thanks to you, I created my own first game, even though it's a clone of Flappy Bird. Now my daughter is playing it and having lots of fun, and I'm watching her enjoy it, feeling like a dream come true. Thank you.
As someone who isn't familiar with code, this process was not easy, but it's the first step. I'm excited to take this game, iterate on it, improve it and move on to cloning different games. I love this style of learning and I'm really excited to see how it all turns out. Thank you for the incredibly helpful tutorial! This was a great starting project where I felt like I understood why I was doing something instead of just mindlessly copying. I'll be referencing this video a lot, I'm sure!
Thank you. This is definitely like one of the best get one started tutorials around without any fluff or needless rambling.
The way you simplify concepts is so good.
Calling a script a "custom component." The animation for components in a GameObject. These clear up so much for me, and I have a ton of non-game development experience.
This is the most comprehensive starter tutorial I've seen and it's exceptionally well made.
The two aspects I like most are:
1) Very engaging: Every little step (in a nicely arranged flow) gives some kind of reward by making the program do something more.
2) Your visualization + explanation of for example the GameObject jar or the if gates are truly awesome. I wish I had such a comprehensive entry video.
3) Number 3 of 2: Good choice to use some legacy stuff. What good is it if you exhauste yourself to learn the new input system at the beginning, but your motivation drops because you don't make any visible progress.
Mark thank you, you are finally someone who understands the difficulty of the youtube learning unity and helps teach others through it
As a uni student trying to learn the basics of Unity for complicated task for a research project I'm breaking into (based around game dev for education): THANK YOU! I have experience coding so some of this is very basic to me, but I can say this tutorial is excellent for beginners and more experienced programmers alike. Visual Studio is my favorite IDE that I've used so far, and I would say I'm very comfortable with it when working on .NET framework projects, but this video really helped bridge the gap on how the game engine interacts with VS as a script editor.
I agree with almost everyone else in this comment section that this is one of the best coding tutorials I've ever seen. All of the analogies were beautiful, I wish more professors knew how to teach this well.
I have tried to learn unity on and off for YEARS and always given up because I reach a point where my own lack of fundamental understanding of the systems stops me from going any further. The way you described everything made so many light bulbs go off in my head . Please make more unity tutorials!!
I know you have other priorities (like working on your own game) but this is one of the best software tutorials I've seen. Great work! Would love to see more in this series and am looking forward to the next installment of Developing too.
As a game artist this is probably the best tutorial I ever seen, So many tutorials Skip explanations and you make them seamless and intuitive, great video. Thanks mark!
it still very hard and very hard to remember anything and hard to understand anything at all because its coding and that is litreally impossible if you haven't been coding ever since you were a little kid💀
@@whitekingcat5118 Some of the best programmers I know picked it up in their mid 20s, quit that mentality or you'll never get anywhere in life.
@@LukeCreates well i don't think it matters if i don't have a life🤷
@@whitekingcat5118 that's what you tell yourself cause you want to give up because it's simply cap
@@teamofwinter8128 but i have already given up🤷 at least at Unity💀
This wasn’t just the best Unity videos I’ve seen, but one of the best programming videos period. Great stuff!
I got stuck on the point system. It kept telling me the script was wrong. Even it showed no errors. I had to scrap all of it. I will try again tomorrow lol
@@AristotleMotivation I was able to get through it without issues, Unity 2022 LTS, Visual Studio 2022. I hope you try again.
@@mauricionapier He Even Mentioned The Issue In His Pinned Comment. I Wasnt Being Suggested The Codes. So I Had To Write Them Manually. And That Didnt Work Out Very Well.
@@AristotleMotivation i have the exact same issue what did you do to fix it?
@@Mirsano I have an idea for you, open the pipe prefab, and then go to the middle collision thing that he created, and in the box collider component, there is this little tick box called "IsTrigger", make sure this is enabled, something that I and many others forget, pretty annoying lol.
This is my first time programming so it was a little difficult but it’s so satisfying seeing the result after typing the code and pressing play in unity. Definitely a fun experience.
Thanks to this video, I finally understood how Start, Update, Void, and Public/Private code functions work.
Its kinda confusing when I'm still learning it off in my classes.
I have some experiences in python, C, C# Illustrator and After effects and it feels good and makes me feel more confident to try this out because there are always parts which are similar. But never the less without such a good structured video and clear explanations I wouldn't came to this point of confidentness. Thanks for this video and your work.
I really appreciate such guys like you which a just sharing knowledge for free! It's so valuable!!!
I cannot express how useful this video is! I am a game design student and the deadline for my project is in 10 days, but I feel like I haven't learned anything all year, because we've not had a lot of lectures, the lectures have been hard to follow, and I've been focusing on other subjects. This one video has really simple instructions that are easy to understand and follow for literally everything that I need, and I feel like I've learned more in the 46 minutes it took to watch it than I have for the whole school year since the end of August.
Which one did you pay for? Really sucks that your school got paid and just let Mark do their job for them.
I'm 11 years old and I followed your tutorial and was able to make a game.
And you learned nothing.
@@rottenmouldybrain Apparently you did too, not about Unity though, just about what it means to be a decent person
@@amazeinggames Who are you to tell me what person i am? Go and look in a mirror first.
@@rottenmouldybrain bro speaking from experience fr
im 12
Nice! It's nice to see you pivot more and more towards game development in addition to your usual game design content. I've been a game developer for over 20 years and my TH-cam channel also caters to the gamedev (and Unity dev) niche, so it's nice to have you as company in this space :)
10 minutes in, I'm overwhelmed, I'm intimidated by how complicated flappy birds is, and I'm so excited to dive deeper!!! Thank you for this video!!!
What's amazing is how you're going to bring this skill to a whole new generation of game devs. When I first started getting into your channel, you were just starting Boss Keys. In the time since I've almost completed an entire degree program in game development. Continue the great work.
Thank you for this. I had zero game dev or programming experience and I already feel like it's clicked after this one tutorial. For anyone who's working on the 'next steps', I'd like to share some of the things I did and how I did them:
First, I realized there were a bunch of things I wanted to do when the game over screen shows. Aside from making it so that the user can no longer control the bird (which was covered in the tutorial), I wanted:
- The pipes to stop spawning
- The pipes that had already spawned to stop moving
- The score to stop counting up if the bird accidentally fell through a middle pipe when the game was over
Plus a few other things. To make this easier, I thought it would be smart to make a new bool in the logic script that I could reference from all the other scripts that needed to change. This bool would tell the other script whether or not the game over screen was active.
So, I made a public bool in the Logic Script and called it gameIsOver. I set it as ==false as default at the top of the script. Then, in the existing gameOver function in the logic script, I added a line of code to change it to true (gameIsOver=true).
This would make it so that gameIsOver = true when the gameover screen is active, and back to = false when the game is restarted.
All I had to do then was set gameIsOver==false as an extra condition for the pipes to spawn in the PipeSpawnerScript, and as an extra condition for the pipes to move in the PipeMoveScript, and as an extra condition for the addScore function to run in the MiddleScript. This is relatively easy, but I won't tell you exactly how to do it so you can try yourself (hint: you need to use double ampersands '&&').
The cool thing about doing it this way is that you always have the gameIsOver bool to reference whenever you want to do something specifically when the GameOver screen is active, so it feels future proof.
If anyone has any feedback or thinks I could have done this in a better way, let me know. I'm eager to learn :)
it isnt letting me import an asset im pressing import nothing hppened
Hey, I'm trying to figure out how to stop the score to go up when the Bird die, and I hard your same idea. But when I try to make a new bool in the logicscript I can't make It as ==false (unity mark it as a syntax error: error CS1003).
I've tryed to write public bool gameIsOver = false; but It seems not ti work the same.
Can you help me on this one?
P.s. Sorry for my poor english
Thaks for the ideas, I'm gomna challange my self to add this and add a highscore :)
This is by far THE BEST unity starter tutorial video I’ve found on TH-cam. The explanations and step-by-step walkthrough is exactly what I needed to get started with unity. I’d love to see you tackle making an RTS in unity!
Man, it took me about 8 hours of painstakingly sifting through code trying to find where I missed a comma or misspelled something; But as someone totally new to this world, I could never have gotten close to this by doing my own research. Cheers!
I've watched so many videos trying to learn Unity and code and this is by far the easiest to understand. The way you break down each element of the code is so helpful and no other videos I've found do this quite as well. Thankyou!
Honestly one of the best tutorials I have ever seen, you can tell you really understand what your talking about due to how simply your able to describe each step.
This has to be the best unity tutorial ever made. You explain everything with both words and visuals in ways that non programmers can still learn and understand. You should be very proud of your work :)
One of the best tutorials I've ever seen. It made me understand what each code does, how and why it works and of course, the basics of unity (2d, at least).
I feel pathetic admitting this, but as someone with severe ADHD and struggling with game dev, this video honestly made me cry. I understand it, I'm following it, and I'm focused on it (as well as I can be, anyway!). Thank you so much. I cannot believe this is free. You're helping so many people with the work you put into your videos.
Glad it helped! Best of luck with your future game dev!
Being a CS student makes the code part so easy to understand. I was looking for this type of video for a while. Ty for the guide.
Also, he doesn’t mention it, but it is best practice to write methods like: “ThisMethod”, as opposed to: “thismethod” or “thisMethod”.
Variables are written like: “thisVar” as opposed to “thisvar” or “ThisVar”.
Other than the fact that it makes it easier to read, it is just commonplace, so if you are just starting to code, simply use these “rules”.
Personally I wouldn't even worry about starting with adding in your own sprites at first. Unity has simple sprites prebuild in that you can use. (such as squares, circles, cubes, and plains) You can use something like the circle for the bird and a square for the pipes. After some rescaling to make the square into a rectangle ( and maybe changing the colors if you want) and you're ready to go! You can always switch out the sprite for your own later. I think it helps to learn to work with fewer resources and focus more on the design and feel of the game rather than looks. (Even the best looking game, if it doesn't play well, won't be to popular) It also teaches how to make placeholder sprites for when you want to add something in or start a new project without having to take the time to make a whole new set of sprites.
For anyone wondering, you can add these into your game by right clicking in the hierarchy and going down to 2d objects > sprites, then clicking on the one you want to use. Then, to switch it out later, just click on the one you want to change and in the inspector scroll down to sprite renderer and then drag in the spite into the box next to the word "Sprite" (It should say whatever the shape you used by default) You may have to readjust some things but then you should be good to go!
i think that's how kirby was originally made too (or at least they used a similar concept)! they decided to just stick with their pink placeholder if i remember it correctly
I used the video, but i used different sprites that i created myself, they were of course crappy but i found out it was that easy to add sprites
I have no artistic talent, so I'm using Mark's sprites, but I like this advice thank you!
Counterpoint: it can be very satisfying to make a game that looks AND feels good to play. It can make you feel more accomplished and like the project is more personal.
If you have a strong aversion to developing artistic skills you can avoid it but i think any developer would benefit from giving it a try
@@Jack_______oh I agree, the game should look and feel nice, i’ve just experienced to many times where you get so bogged down with how the game looks that you never get to actually programming anything and you have files of assets that never get used, or when you go to use them they are scaled wrong or don’t animate well or end up clashing with how you designed a specific mechanic. For me, it’s just a lot easier to have placeholders first and then go in and make it look nice later
The way you explained these concepts and the structuring and editing of this video are so amazing! Really have me excited about working in Unity.
This is SO cool. If you play around with similar stuff then build and learn...you'll eventually be able to do. Don't doubt yourself. Keep learning and doing.
Thanks man! When I got the idea in my head to learn to make games this afternoon, I didn't think I'd have one finished in a couple of hours even if it was with a step-by-step guide and cloning an existing property! This was really helpful and now I feel confident that I can play around and get something more original to work. Appreciate the help.
I don't use unity, I bounced off of it and started my development journey on UE4, but this video and the basic knowledge I've learned through Unreal have really made me want to go back and give Unity a try.
Thank you GMTk.
Man you are like the perfect teacher in TH-cam! I am an Unreal Engine user and I decided to use unity for my 2D games but was hesitant to do so... I saw this video now I am confident I can make any 2D game!
Absolutely amazing. I went from never before having used Unity to having my first game created in one morning. And I love that you ended the video encouraging us to expand on it and even try recreating other games. Really appreciated this content.
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
@@vt-bv4lw me too...
you genuinely have no idea how happy I am you've made this video. I've been saying to myself for so long that GMTK could make a unity tutorial that is actually helpful and ITS FINALLY HERE!!!
@GMTK This is the best tutorial I have ever seen on the internet. Your voice is pleasant, you are witty, patient and relaxed. Summing up each section really makes sense and gives the topic a nice closer. The animations and infographics are just beautiful and really deliver the message. As a programmer (~15 years) who rarely give comments, I can say that this was a refreshing experience for a wonderful technical explanation. Thank you for creating this!
as soon as you said "i gotta figure things out myself", I was hooked
This was such a good tutorial, we need a second one exploring more features!
Honestly even you might not be aware of it, but this tutorial is insanely good. not just for game development, but in any field where I tried to learn something new. You're a very good educator, you speak clearly and direct to the point. But also you know how to reach your audience and of course the editing helps a lot. This feels a lot like your friend explaining the school subject for you in 5 minutes. Like you know what our pain points are and you help us figure them out.
I've been struggling with getting into game development for the past couple of years, but this video has encompassed so much in such that I found incredibly helpful in such a short amount of time. Thank you so much for your attention to detail with the explanation!
You can do this game in Construct 3 in 15 minutes without writing a single line of code.
@@SimuLord I am a game dev, I make revenue every month from my mobile games, I think like a game dev and build my own stuff. I never used Unity and I cannot write a single line of code. No need to be that complicated.
@@far-fetched-ai can you stop yapping like bro let them create their games no one asked if you can create games in construct 3
The way you explained the game object as a container made me understand the whole thing a lot better! Thanks!
I've been a programmer in various fields for over 5 years now, and I think this video should be a prerequisite for a Unity class. Actually, it could even be part of any other class, really. I love how you kept it simple and yet left the doors wide open for exploration. Too many tutorials give everything to the student, and then after the lesson is over, no one learned anything on their own. Quite refreshing and impressive!
Oh, and... VSCode > Visual Studio...... :D
Definitely disagree with Vscode > Visual Studio *for unity*, visual studio is just consistently better for unity with less errors and better debugging and intellisense
@@mrp0001hat about JetBrains Rider?
JetBrains > VScode
This is just such a fantastic tutorial, oozing pedagogical tact from start to finish. You can really tell that you’re someone whose had to learn this stuff, and has then thought very hard about what the best way to teach it would be
I made the painful mistake of adding a Box Collider instead of a Box Collider 2D to the middle of the pipe. Banged my head against the wall for too long. Won't make that mistake again! Thanks for the great tutorial, I learned a lot.
Oh my god, I had this issue. I couldn't for the life of me figure out why my score wasn't triggering. I wish TH-cam had a search function in the comments so I don't have to scroll through a hundred "nice video" comments to find helpful tips like this.
I did box collider 2d but it's still not working 😕
@@HollowPoint503 Every website has a search function for text; on Windows, Ctrl+F, on Mac, Command+F
@@tacosauce935 have you figured it out? i moved on to the rest of the tutorial, completed, quadruple checked that all the code is the same and i still can't get the score to increase
@ed I don't know If you will have the same issue as me but make sure that you have you PIPEMOVESCRIPT attached to your MIDDLE PIPE prefab. This was my issue if it's not I might have a few more options left to tell you
Honestly man, I can't thank you enough! every single tutorial I've watched up until now were very confusing. I'm a visual learner, and not many videos (at least from what I've seen) do that.
This is probably the best intro for a game developer. The way you explain it is just amazing. Do the same but with UE. I think a lot watching your videos will appreciate it.
This tutorial has gotten me further than 20 hours of Unity videos otherwise. You are a king. I'm so glad you took this journey as it's enabling others to grow and experiment.
thoroughly impressed with your introduction to not only Unity but basic coding as well! great job man, this was massively helpful
Министр, спасибо за этот метод - он действительно помогает достигнуть целей.
This actually makes me look at simple games from a totally new perspective. Lotta work even if they look real simple.
This is brilliantly perfect and exactly what I needed. It puts all everything together i needed to know, without covering the basics i knew.
10/10 no repetition, straight forward and extraordinarily explained
Hello, I see that you understand how everything works more or less, could you help me with something small? When I write code in visual studio, I don't see many options to complete the code. Do you know how to fix it?
@@vt-bv4lw Look at the first comment
Love it! I watched some tutorials when I was going to try design a game last year, but all I really learned was to replicate what they made. I didn't have the patience (nor time) to do the 'playing around' I typically need to do to actually learn something. But this granular look with both setting it up and doing the stuff in the engine is really helpful! The modular approach feels more like learning what I'm doing instead of just doing something.
This is objectively the best Unity tutorial I've ever watched. Great job! 👏
Never seen such a perfect tutorial. A perfect teaching pace combined with animations and a clear and understandable language
Mark you’re making me cry with how reasonable and considered this is, i wish people put out more tutorials like this for the tools I use 😂 🙏
If you can't use LogicScript at about 33:35, It's because you named the previous script something else. He called the script "LogicScript" and then used that same name in visual studio. You gotta use the same name
Thank you :)
THANK you SO MUCH!
Thankssssss ❤
thank you very much
Tried like 15 tutorials still learned nothing finally got tired and came to TH-cam and I found this masterpiece
As someone who has used Unity for nearly a decade, I obviously didn't get much from this (Though you reminded me that ContextMenu exists...), however this is definitely a great resource for those starting out. I have a few friends who have wanted to get into Unity and this video will now be among the resources I share with them. I've loved so far watching you progress with the engine. Maybe at some point it'd be interesting to see you try to learn the basics of other engines as well, though I'd recommend getting good in one engine over learning too many, any of the popular engines will work for most if not all games, and familiarity is far more important than feature sets the majority of the time.
Some notes for those who want some additional pointers, these can mostly be ignored if you're just starting out and trying stuff out:
1) public variables are fine when starting out, however the fact that they can be accessed by other scripts can be an issue. You may down the line forget why a variable is public and attempt to modify it in the code which may mess things up. If the reason for the variable being public is solely for placing it in the inspector, you can make the field private and add [SerializeField] above it (with the brackets). This tells Unity to allow it to be serialized (serialization is the process of taking an object, turning it into some format that can be stored, and then turning that back into an object). The unity inspector is able to display serialized fields/variables.
2) In the timer example he showed off, in the event the timer is above it's max, nothing is added to the timer, this actually causes the timer to be ever so slightly off each time it spawns an object. The Time.deltaTime should be added to the timer regardless of whether it's above or below the threshold. Adding it before resetting it to 0 will effectively do nothing, so it's best to add the time to the timer after the if statement. This is only important if completely accurate time is what you're going for, for this it really doesn't matter.
3) When working in 2D you'll often have to use Vector3 a lot still, as shown in the video. It's worth noting however that a Vector3 can be constructed with only the x and y values provides like new Vector3(x, y), in which case the z is automatically considered 0. This is useful when dealing with a lot of Vector3's in a 2D game. It's also worth noting that a Vector2 will automatically be converted to a Vector3 when used in something that wants a Vector3, doing so is functionally identical to using Vector3 with only x and y, but be careful because this works the other way as well and can cause problems, a Vector3 can be converted to a Vector2, and unlike the other way around doing Vector3 -> Vector2 loses information as it drops the z value, something to be aware of.
4) I wouldn't worry about it when starting out, but in addition to the Update method there's also FixedUpdate. While Update is ran every frame, FixedUpdate is ran on a more fixed schedule. Most if not all physics calculations should be done in FixedUpdate instead of Update. It's worth noting that when in FixedUpdate you should use Time.fixedDeltaTime instead of Time.deltaTime. Input should never be handled in FixedUpdate as you may miss some input events, Inputs are processed each frame, but the fixed update can sometimes run multiple times a frame so dealing with inputs in it can be dangerous. Again for simple games you don't really have to worry about FixedUpdate, just note that it exists.
Actually to add onto point #2 instead of setting the timer to 0 when the threshold is met, it's actually better to subtract the threshold from the timer value, so if one frame it was 0.995 and the next frame it's 1.015, and the threshold is 1 as an example, the timer would be set to 0.015, Because this frame was 0.015 of the threshold late, the next one will run approximately 0.015 sooner. This will actually keep the timer completely on schedule without drifting.
One of the greatest tutorials on any subject, ever. Terrific explanations, entertaining and engaging. Bravo 👏
terrific means something that causes terror
For people who are not getting the auto complete and Intellisense and Unity - VS attachment in general, try to go to preferences>external tools and reload the project files.
If the Solution Manager in VS says Assembly-CSharp incompatible, right click on it and select reload with additional components or something similar to it. It must reload all the assemblies. Try reloading the project files again after that.
Have fun making games!
OMG tysm
im stuck, can you please explain it to me like im an idiot?
or maybe you could help @Cryptition-
@@eladkatzir7855 for me i just did it like this, in unity after you open a project go to Edit > Preferences > External Tools, and then for the first section "External Script Editor" select the microsoft visual studio one instead of just nothing and that might fix it.