Ads skipped

The Unity Tutorial For Complete Beginners

7.4M views · 2 Dec 2022

Comments · 8.7K

  • @GMTK · 3 years ago (edited) · pinned

    If Visual Studio is not automatically suggesting code for Unity, please follow these steps:<br><br>In Unity, go to Edit - Preferences.<br>Under External Tools, pick Visual Studio from the &quot;External Script Editor&quot; dropdown. <br>Then completely shut Visual Studio, and open it again by double clicking a script in Unity.<br><br>It should now suggest code as you type!

    3.6K

  • @fallbranch · 3 years ago

    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,

    10K

  • @Chodor101 · 3 years ago

    Youtube gods decided that I shall watch this, who am I a mere mortal to judge their decision.

    3.7K

  • @TheFlatMan0 · 1 year ago (edited)

    EVERYONE!!!!<br>Do this as Unity 5 had been updated and the program in the video might not work in the new Unity 6.<br>So, to make the program work do this setting in the Unity editor :-<br><br>Go to Edit → Project Settings → Player → Other Settings<br>Scroll down to Active Input Handling<br>Change it from Input System Package (New) → Both<br><br>And make sure to use linearVelocity in the place of velocity in the program as unity has updated the fuctions....<br>btw Welcome ; )

    1.7K

  • @michaelcooper9554 · 3 years ago (edited)

    I&apos;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.<br><br>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!<br><br>EDIT 12/07/2023<br>Did a survey with the students at the end of course, asked about this video tutorial, here are the results<br><br>Average rating out of 5 (rather unscientific question) - 4.13<br><br>What the students said:<br>It was very fun and exciting to see a game which you coded work.<br> <br>Straight forward and helpful for clueless beginners.<br> <br>The tutorial is very clear and easy to follow<br> <br>Straight forward and very helpful.<br> <br>It was easy to listen to, no overcomplicated steps and enjoyable to do.<br> <br>thought I wasn&apos;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)<br> <br>Nice voice and good for beginners.<br> <br>Very organized and it a great transcendence<br> <br>Easy to understand and follow.<br> <br>Good experience to learn more about game programmings.<br> <br>It&apos;s detail and easy to understand<br> <br>I think its pace and information is good for beginners for their unfamiliarity with coding<br> <br>It was pretty good, the only thing that kind of threw me off was his strong accent.<br> <br>Excellent pacing which gave the time for you to work on it, and took the time to explain the purpose of each function<br> <br>straight forward and easy to understand and complete<br> <br>It very gud<br> <br>it was simple and good<br> <br>It was good for a starting tutorial for flappy bird.<br> <br>the tutorial was good, but there was a lot that had to be explained outside it.<br> <br>Should have more explaining on the code.<br> <br>It&apos;s long but it helps you understand a lot of stuff

    2.8K

  • @kristianthaler6525 · 3 years ago

    I&apos;ve been learning for 2 years now, but I still like to come back to videos like this take some pride in knowing I&apos;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.

    2.3K

  • @theluthershow · 1 year ago

    As someone with 0 coding experience, I followed this twice and it was super helpful!<br>The first time through I followed the directions exactly.<br>The second time through, I gave each object, variable, function, etc. a unique name, added my own ideas, and learned a lot.<br>I recommend doing both!

    386

  • @CodeMonkeyUnity · 3 years ago

    Really great overview of the basics coupled with the usual excellent editing! Nice!<br><br>Some more advanced concepts for anyone who wants to keep learning to the next level:<br>- 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.<br><br>- 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. <br>For example at <a href="https://www.youtube.com/watch?v=XtQMytORBmM&amp;t=735">12:15</a>, what does that &quot;10&quot; 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.<br>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&apos;s no need to remember what &quot;10&quot; meant since it uses a proper variable name that clearly explains what it does.<br>More info on Magic Numbers: <a href="https://www.youtube.com/watch?v=CQ5xHgRZGQo">https://youtube.com/watch?v=CQ5xHgRZGQo</a><br><br>- 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.<br>For example at <a href="https://www.youtube.com/watch?v=XtQMytORBmM&amp;t=668">11:08</a> the Rigidbody is public but you don&apos;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.<br>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&apos;t need to keep in mind your entire codebase since only the code in that class can read or write that field.<br>So in that case you have two better options, you can make it private, but then you can&apos;t drag the reference in the inspector. Since the Rigidbody is on the same object you can grab the reference with GetComponent&lt;Rigidbody&gt;(); that&apos;s one approach.<br>Another approach is make it private but add the attribute [SerializeField] this lets you make a field private so it&apos;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.<br>More info on why you should NOT make everything public <a href="https://www.youtube.com/watch?v=pD27YuJG3L8">https://www.youtube.com/watch?v=pD27YuJG3L8</a><br><br>- Tags: They are strings and Strings are very error prone so you should really not use them, if you write &quot;logic&quot; instead of &quot;Logic&quot; it will break, if you write &quot;Logic &quot; it will break, &quot;Iogic&quot; &quot;L0gic&quot;, etc. Just looking at it they all look correct and the code doesn&apos;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.<br>More on why you should avoid strings: <a href="https://www.youtube.com/watch?v=Q8n1uFTG97s">https://www.youtube.com/watch?v=Q8n1uFTG97s</a><br> <br>- 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.<br>So for example for updating the UI, <a href="https://www.youtube.com/watch?v=XtQMytORBmM&amp;t=2135">35:35</a> 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.<br>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.<br>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.<br>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.<br>Here&apos;s some more info on C# Events <a href="https://www.youtube.com/watch?v=OuZrhykVytg">https://www.youtube.com/watch?v=OuZrhykVytg</a><br><br>- Text: Unity has two Text systems (which itself has two components for both UI and World) <br>Mark mentioned it at <a href="https://www.youtube.com/watch?v=XtQMytORBmM&amp;t=2601">43:21</a> how the Text used in the video is the Legacy text which is extremely limited so nowadays you should instead use TextMeshPro<br>In the code, instead of using UnityEngine.UI; you use using TMPro;<br>For the field instead of Text you would use TextMeshProUGUI for UI Text and TextMeshPro for World text.<br><br>- 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&apos;s what I use when I&apos;m just making a prototype since it&apos;s very easy to use.<br>If you want to learn more about the new Input System I covered it here <a href="https://www.youtube.com/watch?v=Yjee_e4fICc">https://www.youtube.com/watch?v=Yjee_e4fICc</a><br><br>- Render Pipelines: Mark quickly selected the 2D template and started making the game, this template uses what is called the Built-in Render Pipeline<br>This is the render pipeline that Unity has had for years, it works great but nowadays you have two other options <br>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.<br>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.<br>There are other Templates that you can download which come with the Render Pipeline already set up.<br>In most cases nowadays you should be using URP, it&apos;s what I always use in my videos and its what I&apos;m using in my upcoming Steam game Total World Liberation <a href="https://www.youtube.com/watch?v=6DGDWfPdn3w">https://www.youtube.com/watch?v=6DGDWfPdn3w</a><br><br>- 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&apos;s how they are organized.<br>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&apos;re making a game that is 1+ years away from release.<br>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.<br>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<br>More on Unity versions <a href="https://www.youtube.com/watch?v=LLYhTWEX2Wc">https://www.youtube.com/watch?v=LLYhTWEX2Wc</a><br><br><br>Great job with the video! I&apos;m sure this will help tons of people on their game dev journey!

    2.1K

  • @annepgamedev · 2 months ago

    Started with this and three years later graduated with a first class honours degree from my dream uni in Game Design. Thank you so much GMTK!

    29

  • @jonasgajdosikas1125 · 3 years ago

    quick tip: <br>you probably don&apos;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 &quot;[SerializeField]&quot;

    1.4K

  • @felikowski · 3 years ago

    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!

    1K

  • @chaotic9729 · 3 years ago

    After finishing this tutorial, I am now confident to make the next Souls Game.

    937

Up next

LIVE

How Much Money my Indie Game Made (After 1 month)

Ratbit Games · 1.6M views

LIVE

How I learned Unity without following tutorials (Developing 1)

Game Maker's Toolkit · 2.4M views

LIVE

The History of Every Video Game Genre

Game Maker's Toolkit · 823K views

LIVE

Can I Make a Better AI Than AI?

commonLuke · 763K views

LIVE

The ONLY Pixel Art Guide You Need (Beginner to Advanced)

Juniper Dev · 1.7M views

LIVE

choosing a game engine is easy, actually

samyam · 1.3M views

LIVE

Every Game Engine Explained in 19 Minutes

Explainer Chris and explainerguy01 · 73K views

LIVE

Your First Game in Unity: Ghost Evader: Part 04: Player Setup

Kelvar's Game Development · 85 views

LIVE

Once You Understand MONEY, You'll Stop Saving It [PART #1]

LITTLE BIT BETTER · 3.4M views

LIVE

Everything You Need To Start Making Games (As A Beginner)

Juniper Dev · 2.4M views

LIVE

20 Game Dev Tips I Wish I Was Told Earlier

Gambit · 490K views

LIVE

3D Survival Game Tutorial | Unity | Part 1: Getting Started & Player Movement

Mike's Code · 729K views

LIVE

How I Make Games with NO CODE

Jerbob · 458K views

LIVE

It's Dumb, but it Breaks the AI Bubble

Vex · 468K views

LIVE

How To ACTUALLY Start Making Games

Its Rascal · 153K views

LIVE

Godot Game Development – Crash Course for Beginners

freeCodeCamp.org · 1.3M views

LIVE

The 100 Games That Taught Me Game Design

Game Maker's Toolkit · 2.5M views

LIVE

How To PROPERLY Start Making A Game

Brainless. · 712K views

LIVE

Game Development for Noobs | Beginner Guide

Flow Studio · 922K views

LIVE

LEARN UNITY - The Most BASIC TUTORIAL I'll Ever Make

Imphenzia · 3.5M views

YouTube, with the door locked.

Aegis plays a clean stream instead of YouTube's player, so pre-roll ads, trackers, and fingerprinting never ride along. Drop Shields any time if you want the official player back.