GAME OVER - How to make a Video Game in Unity (E08)

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 3,4 тыс.

  • @Brackeys
    @Brackeys  7 лет назад +813

    Hello everyone!
    I've addressed this a few places (we talked about it in one of livestreams) but I probably haven't been clear enough to people who don't watch all the videos :)
    I've decided to focus more on standalone videos and smaller series. The reason for this is that I found that both the Tower Defense and the Multiplayer FPS series were getting too long which meant that only a very small fraction of the people who started watching actually got to the later videos. And this is a shame because a lot of the videos covered later in the series aren't harder to understand than the first ones and might be just as important.
    So instead I want to create videos that can apply to as many games as possible while still tackling some of the more advanced subjects. I think the Scope, Bullet Time and Volumetric Lights tutorials are good examples of this because they both cover subjects requested for the FPS and Tower Defense series but in a way that makes it usable to people working on other games as well.
    On top of that I had been getting request for a looong time to remake the Make a Game course because it was getting outdated. So I thought this would be a good opportunity to create a smaller series for beginners.
    I think overall since I started this new approach that the comments and feedback has been way more positive and the videos are getting way more views on average. I've also found that I have way more fun creating videos this way because it can be much more varied.
    I hope you guys understand and I'm just excited to bring you new interesting videos - Especially once we wrap up this short series :D
    Thanks for being awesome!

    • @talha9585
      @talha9585 7 лет назад +5

      Brackeys you can use !gameHasEnded instead of == false, prob you know but you know.

    • @DevRightms
      @DevRightms 7 лет назад +9

      Nice :)
      Brackey , can i ask you about your Pc specs because i noticed that game development on your
      PC is a lot faster than mine.
      I will love to know about that ...

    • @سلتوحبندخيلالله-س2ق
      @سلتوحبندخيلالله-س2ق 7 лет назад +11

      I want to translate your videos from English to Arabic.

    • @game_over5271
      @game_over5271 7 лет назад +3

      Brackeys Awesome!

    • @diegocrusius
      @diegocrusius 7 лет назад +4

      I wish we could add tags to the video so it would be much easier to browse through them and go directly to where we want. I notices you try to help with this by naming your videos accordingly though.

  • @99shafan99
    @99shafan99 5 лет назад +729

    BUG FIX: For all of you who got an exception "The namespace '' already contains a definition...": Check if you have some of the script files in the Assets folder as well as in the scripts folder.
    If so, make sure the ones in the Scripts folder are updated and delete the ones in the Assets folder.
    This might have happened if you had the scripts open while moving them to the Scripts folder.
    It worked for me, hope it worked for you :)

  • @MoreST6
    @MoreST6 6 лет назад +927

    Just want to say MAKE SURE YOU SPELL EVERYTHING RIGHT! Spent 2 hours trying to see what was wrong with my scripts and it was all because I spelt Manager "Manger"

    • @coat68
      @coat68 6 лет назад +10

      Ya Boi Starmix Oh, the irony!

    • @coat68
      @coat68 6 лет назад +5

      Ya Boi Starmix (*Sleep)

    • @MoreST6
      @MoreST6 6 лет назад +10

      SPELL*

    • @coat68
      @coat68 6 лет назад +3

      @@MoreST6 That's it! 👏👏👏

    • @aryan5695
      @aryan5695 6 лет назад +4

      Lol I did the same. I spelt Position as "Postion"

  • @ant1bliss
    @ant1bliss 3 года назад +48

    I spent sleepless hours last night trying to figure out where I'd went wrong with this lesson. Eventually, I decided to delete my progress and start it over fresh today. I will never know the error I made last night, but it just goes to show, attention to detail is key, and a well-rested brain is our best defence against making mistakes... ONWARD!

  • @MrAydinminer
    @MrAydinminer 5 лет назад +983

    "We Simply Drag Our Score Script To Scripts Folder."
    Jokes on you.
    I did it last part.

  • @prefixn5677
    @prefixn5677 2 года назад +10

    Brackeys is absolutely amazing. His tutorials are clear and to the point and if something ever gets outdated, his community got your back in the comment section. you guys are all amazing.

  • @LetsDrinkWindex
    @LetsDrinkWindex 7 лет назад +80

    This guy is so happy all the time.
    His smile just makes me feel tingly inside.

    • @priyankadeshmukh3621
      @priyankadeshmukh3621 4 года назад +2

      right...

    • @teez386
      @teez386 4 года назад +1

      ...

    • @LetsDrinkWindex
      @LetsDrinkWindex 4 года назад +17

      OH GOD I DIDN'T THINK IT COULD BE INTERPRETED IN SUCH A LEWD CONTEXT OH GOD I DIDN'T MEAN IT LIKE THAT!!! WHAT TF WAS I THINKING 3 YEARS AGO JESUS FUCKING CHRIST HOLY SHIT. I SWEAR I DIDN'T MEAN IT LIKE THAT AT ALL!
      i'm not gay I swear!

    • @bennettoneill203
      @bennettoneill203 4 года назад

      @@LetsDrinkWindex XD I knew what u meant lol

    • @seymorebutts2798
      @seymorebutts2798 4 года назад +1

      ew

  • @timsonss
    @timsonss 4 года назад +393

    Game Over happened in real life. We will miss you Brackeys!

    • @Siduch.
      @Siduch. 4 года назад +3

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

    • @MMMasterLego
      @MMMasterLego 3 года назад +25

      But he's not dead

    • @orivat3845
      @orivat3845 3 года назад

      😭😭

    • @Мемыкаксмыслжизни-ы1з
      @Мемыкаксмыслжизни-ы1з 3 года назад +1

      no way wtf

    • @Мемыкаксмыслжизни-ы1з
      @Мемыкаксмыслжизни-ы1з 3 года назад +14

      you scared me so much damn i thought he died

  • @ImusingX
    @ImusingX 5 лет назад +155

    why if i name my script GameManager it gets a Settings-Icon?

    • @MichaelKeaveneyYouTube
      @MichaelKeaveneyYouTube 4 года назад +49

      It's simply the script symbol for a C# script named GameManager. You did nothing wrong.

    • @0oh_no
      @0oh_no 4 года назад +29

      Unity detects that it's the Game Manager (because of the name) and will set the icon to make it more visual

    • @daring7495
      @daring7495 4 года назад +3

      Same

    • @daring7495
      @daring7495 4 года назад +5

      Yet my other scripts look like a # symbol

    • @ImusingX
      @ImusingX 4 года назад +2

      @@daring7495 yeah lol

  • @drfurbz
    @drfurbz 5 лет назад +120

    The Boolean part made my Brain feel like scrambled eggs, however after a few re-watches your explanation finally sunk in, loving the series man ... honestly cannot believe i'm starting to comprehend C#

    • @sebastienbergeron4679
      @sebastienbergeron4679 5 лет назад +3

      i am not sure if i understand it

    • @fahadaameer5618
      @fahadaameer5618 5 лет назад +7

      I rewatched it 10 times and I still don't understand -_-||

    • @CottidaeSEA
      @CottidaeSEA 4 года назад +1

      @@fahadaameer5618 Wow, replying to you is a bit funky, the text goes from right to left like with your language. Basically, you check "is 0 actually 0?" then you change the value so that it's never 0 again. That's essentially how it works, but instead of numbers (even though they are numbers in the background) it's instead true or false. Something a bit more readable for us humans.

    • @CottidaeSEA
      @CottidaeSEA 4 года назад +4

      ​@@sebastienbergeron4679 I wrote a reply to the Amir dude somewhat explaining it, although I'm guessing you already understand it at this point. If it's easier for you to understand, a boolean is either 1 or 0 (true or false) which means gameHasEnded == false is like checking if 0 is actually 0. Since gameHasEnded can only be false before that point, this will always be true the first time. You then set it to true (1) to make sure it never triggers again.
      As for why it's == that's simply because = sets a value, so it's used to avoid duplicate uses for the same syntax. That makes the code more readable at a glance. Having multiple uses for the same thing is called overloading by the way.

    • @mainuddinnayeem
      @mainuddinnayeem 4 года назад

      @@CottidaeSEA i was gonna ask you this in more detail but then while typing the code here somehow it finally understood it. Damn. :D :D

  • @feasiblepi8373
    @feasiblepi8373 6 лет назад +159

    FIX NaN!
    In Edit> Project settings> physics, changing Contacts Generation to 'Legacy Contacts Generation' Finally got rid of the NAN message (I tried it a lot and it doesn't come up anymore).
    Credit - Sebastian Rijks
    (up vote to help people)

    • @PurplySkye
      @PurplySkye 5 лет назад +1

      r/IHaveReddit

    • @zokaper801
      @zokaper801 5 лет назад +2

      this is not reddit mate

    • @yodaprogamer2032
      @yodaprogamer2032 5 лет назад

      @@PurplySkye fail

    • @Drad9428
      @Drad9428 5 лет назад

      appreci8 it m8

    • @Siduch.
      @Siduch. 4 года назад

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

  • @anigamerisgaming3110
    @anigamerisgaming3110 2 года назад +20

    Fun fact! For me, if you name the game manager script like GameManager, you don't need to attach it to an object! To tell if you got it right, the script should have a cog icon instead of the standard "script" icon!

    • @nicolasszorc1356
      @nicolasszorc1356 10 месяцев назад

      at 4:02 I got an error, FindObjectOfType().EndGame(); is not accessable due to its protection level. It took me forever but when I read your comment, I changed the name of the script to not get a cog and it worked. Do you know a way to call EndGame(); using the GameManger as a cog?

    • @TheShadespawn
      @TheShadespawn 8 месяцев назад

      @@nicolasszorc1356did you figure this out or you still need help? 😂 it’s been a while so just checking

  • @moahammad1mohammad
    @moahammad1mohammad 4 года назад +112

    And this is how you make a Ketchapp game in under a hour

  • @jseneque
    @jseneque 7 лет назад +4

    I really love the minimalistic, colour palette and font in this simple prototype.

  • @InterestingRedditStories-b7e
    @InterestingRedditStories-b7e Год назад +16

    Brackeys: We should be getting a few errors
    Me: Gets no errors the one time I was supposed too

  • @mikeydlad00
    @mikeydlad00 4 года назад +13

    For anyone who was stuck with the GameManager, make sure the icon next to the script is the C# icon and not gears. If it is gears recreate the script again only with a different name such as Manager instead. This worked for me at least

    • @BamnBooper
      @BamnBooper Год назад +4

      2 years from now and you just saved my programming career xD

    • @tadakuniyasuda8214
      @tadakuniyasuda8214 Год назад

      @@BamnBooper The same. And you are my inspiration for my heart. Thanks!

    • @JellyGang680
      @JellyGang680 Год назад

      I did this but I don't see the "game over" when I die

    • @AndrewQuinlan-or9dd
      @AndrewQuinlan-or9dd Год назад

      Thanks man

  • @jedifiter23
    @jedifiter23 3 года назад +20

    for anyone in 2021 doing this tutorial, with the auto lighting bit what you have to do is generate the lighting, it'll be a button that looks like a drop-down menu at the bottom of the 'Scene' section of the Lighting panel, just click Generate Lighting and it works

  • @quarathunisahussain8416
    @quarathunisahussain8416 4 года назад +27

    The happiness when VS tells you "No Issues Found". xD

  • @BananaLlama
    @BananaLlama 6 лет назад +4

    I would not be making games without you! You're a life saver! Thanks!

  • @froggot7057
    @froggot7057 6 лет назад +263

    Anyone else realize that even if u follow him step by step there is STILL no reference to the game manager in the player collision script

    • @coolkcroyale
      @coolkcroyale 5 лет назад +13

      Froggot yes! I was going through every single little thing of code to see if I had exactly what he had and it still had no reference

    • @amelierxse
      @amelierxse 5 лет назад +20

      Froggot i’ve been stuck on this for ages... i’ve rewritten it like 3 times and the reference still isn’t showing up, and when i go into play mode there are no errors (Brackeys says ‘there should be errors in the console’) so i know something’s wrong :(

    • @coolkcroyale
      @coolkcroyale 5 лет назад +36

      amelie rose there are errors because he deleted and replaced the player to demonstrate something so he had to put back the references to the player for the main camera and something else.

    • @amelierxse
      @amelierxse 5 лет назад +4

      CoolKCRoyale omg thank you! i see it now, that was a really dumb mistake :0

    • @coolkcroyale
      @coolkcroyale 5 лет назад +3

      amelie rose np lol

  • @willpetillo1189
    @willpetillo1189 4 года назад +2

    Time-stamps for reference:
    0:25: Creating a Game Manager
    2:43: Finding the Game Manager with FindObjectOfType
    4:52: Detecting when the player has fallen
    6:10: Ensuring the game only ends once with a conditional
    7:18: Restarting the game
    9:07: Turning off auto-baked lighting
    10:00: Using Invoke to add a delay before the game restarts
    10:58: Adding the level to the project's Build Settings

  • @fox_sox
    @fox_sox 4 года назад +37

    For anyone who gets an error for the
    ().EndGame();
    Just remember that
    1. You need to make the GameManager Script have a
    *public* void EndGame()
    2. That you specifically save on that specific script to get unity to update to that :)! I saved on the PlayerCollision Script and I just assumed it would save for both scripts.
    You probably don’t have this problem but it’s not going to break your code if you apply these things so if you have even a remotely similar situation, I recommend you try this! Sorry to everyone who has more complicated problems than this ^^’

    • @dvr380
      @dvr380 2 года назад +2

      i actually didn t save the GameManager script, despite making in public. After i saved both scripts, that worked fine, thanks!

    • @skewminds3756
      @skewminds3756 2 года назад +3

      OMG Thank you so much!!! I did not save both the scripts and that's why was getting the error! I NEVER THOUGHT I WOULD MAKE A SUCH A MISTAKE DESPITE BEING AN EXPERIENCED PROGRAMMER!! Thanks again! U saved the day

    • @fox_sox
      @fox_sox 2 года назад +2

      @@skewminds3756 Man this is from a long time ago and I have no idea what I was even referring to anymore, but glad I could help! I just remember this being very frustrating lol.

    • @skewminds3756
      @skewminds3756 2 года назад +2

      @@fox_sox haha, anyway, thanks again!

    • @JustBall247
      @JustBall247 2 года назад +4

      i followed this tutorial exactly and got an error
      if your GameManager script has a gear next to it you need to delete it and delete the GameManager from your hierarchy.
      Then restart the video.. you can rename it GameManager again in the hierarchy, but when you make your #C script name it “Manager”
      follow the video and when he goes to the player collision type it as:
      FindObjectOfType().EndGame();
      that’s what fixed my error

  • @VP-yk8rk
    @VP-yk8rk 6 лет назад +305

    Brackeys already knew the title of Avengers 4: Endgame :P

    • @adamthomas6951
      @adamthomas6951 5 лет назад

      He sure did

    • @aramb7077
      @aramb7077 5 лет назад +2

      Hallo mede Nederlander stem PVV

    • @cathacker13
      @cathacker13 5 лет назад +2

      "😱"
      I'm gonna stop you right here

    • @KVSGamer
      @KVSGamer 5 лет назад +3

      Hey I Was Going To Comment That

    • @KVSGamer
      @KVSGamer 5 лет назад +2

      @@kkibi LOL XD

  • @singnrag
    @singnrag 3 года назад +2

    sir,
    after reaching this far, i want to thank u so much
    i have made an almost complete game.. im 15 yrs old, always wondered how to make a game, at last i have made one game, in unity, using basic codings and not directly by the templates and prefigured games on the web..
    i m just so happy to build this game, and it is really cool, wish u would be here trying my game on my pc..

  • @xDerpygamer
    @xDerpygamer 4 года назад +5

    For those of you confused about the bool part (cause sure was am for a good 15 minutes haha)
    bool can only be read as true or false, meaning there can only be 2 options for the command to read it as
    basically what he did was set the "phase" 'gamehasEnded' equal to false at the beginning; so for example when the player falls down below -1f on the y-axis on the PlayerMovement script it'll call on the 'GameManager' to execute the command 'EndGame'
    since 'EndGame' has 'gamehasEnded' = true, that means the statement is now a true statement.
    so IF the 'gamehasEnded' is a true statement then it'll say "yo we true out here" so whatever if statement you type up (ie debug log for "game over") it'll only display as soon as that statement is true.
    Hopefully this helped someone haha, I'm also new to programing so hopefully, I didn't confuse anyone.
    Programmers let me know if I interpreted that correctly haha
    to my fellow new people out there, let's keep prevailing!

    • @tomastricot525
      @tomastricot525 2 года назад

      But, he set the bool statement to false, so wouldn't it mean that it is true that the statement is false?

    • @krishnarai4854
      @krishnarai4854 Год назад

      Finally it make sense a little bit. I was just trying staring at it and trying to make sense out of it for 10 15 mins.

  • @Raniaska0306
    @Raniaska0306 4 года назад +132

    took me like an hour to watch a 12-minute vid lmao

    • @kingmole7617
      @kingmole7617 4 года назад +1

      raniaska only an hour 😂

    • @bedo2950
      @bedo2950 4 года назад

      What if you watched a 1 hour tutorial video it is going to take decades

    • @Siduch.
      @Siduch. 4 года назад

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

    • @LordPenisTheThird
      @LordPenisTheThird 3 года назад +2

      those are rookie numbers

    • @GODEDITS-W
      @GODEDITS-W 3 года назад

      impossible

  • @animeheat9230
    @animeheat9230 4 года назад +2

    After spending 2 days on an error I realized that I spelled Manager Maneger in one place that I didn’t even regard in the code looking for spelling mistakes because it was stating the name of the script 🤦🏼‍♂️ Thank you for the amazing videos bro!!! You are getting me through quarantine

  • @3th4nP31ff3r
    @3th4nP31ff3r 4 года назад +32

    I’m going to have to watch this series at least 10 more times😂

    • @Siduch.
      @Siduch. 4 года назад

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

    • @3th4nP31ff3r
      @3th4nP31ff3r 4 года назад

      @@Siduch. Honestly, I’m not sure. Just keep checking the code or anything else that might screw up the game.

    • @dakshrokadia5555
      @dakshrokadia5555 3 года назад +1

      12 time lmao and I’ve finished everything besides this

  • @lynxunderscore6569
    @lynxunderscore6569 3 года назад +13

    If you are having problems disabling auto light calculations in the newer versions of unity just go to the light tab and at the bottom it will say "Generate Lighting" and click it.

  • @Srcsqwrn
    @Srcsqwrn 4 года назад

    Around 4:34 you're talking about the errors I identified a vid or two back! I'm glad I was able to locate the issue on my own, but also glad you covered it just in case, too!

  • @UAVwaffle
    @UAVwaffle 6 лет назад +13

    4:15
    That feeling when you check your work cuz you didn't get any errors XD
    Apparently I already made the reference.

  • @adrianherralgot4071
    @adrianherralgot4071 5 лет назад +49

    All of my code was perfect then I did something and now everrything with "endgame", "restart" and gamemanager has a read mark under it

    • @adrianherralgot4071
      @adrianherralgot4071 5 лет назад +2

      Pls help me :'(

    • @murphy2480
      @murphy2480 4 года назад +2

      Sammmeeee

    • @styo5396
      @styo5396 4 года назад +1

      Ive done evrything correct, but i never get the endgame message in console please help

    • @puggpry4194
      @puggpry4194 4 года назад

      What the crap is Artifact meta info? And why was it not found?

    • @tdawg6348
      @tdawg6348 4 года назад

      Just look around until you fix it

  • @whitefang8329
    @whitefang8329 3 года назад +1

    Lifesaver! Finally, I am starting to understand Game Manager.

  • @kadencrozier3861
    @kadencrozier3861 7 лет назад +101

    Sometimes if you go of the edge a little and then come back on, the player disappears and the score says NaN and It just stops. I don't know if this has happened to anyone else, but it happens often for me.

    • @ironix03
      @ironix03 7 лет назад

      No it doesn't happen for me. Maybe check if your code is correct

    • @sarthaktyagi2701
      @sarthaktyagi2701 7 лет назад +2

      Its Happens but that doesnt mean your code has a error, its like when we approach the edge sometimes unity get an error and this thing is not to worry

    • @CrashernoidTheYoutuber
      @CrashernoidTheYoutuber 7 лет назад +2

      find a fix? having the same problem :C

    • @Cmad1202
      @Cmad1202 7 лет назад +2

      Same happens to me:
      transform.position assign attempt for 'Main Camera' is not valid. Input position is { NaN, NaN, NaN }.
      UnityEngine.Transform:set_position(Vector3)
      Follow_Player:Update() (at Assets/Scripts/Follow_Player.cs:9)
      Tried to google it, and my guess is that the z axis gets kind of "stuck" in the ground object, which fucks up to text/score script. Any fixes?

    • @caramonfire
      @caramonfire 7 лет назад +1

      Same problem here. Also looking for a fix.

  • @przemysawpakua4179
    @przemysawpakua4179 4 года назад +11

    Great Tutorial!
    I'm adding many more things in it to learn: slow motion, music, soud effects, restart if you press a button and i'm gona turn this game into mobile! It's the best free tutorial.
    I knew basics of C# before, so it's easier to me :D

    • @maggiethegamer1271
      @maggiethegamer1271 4 года назад +2

      how do you get slo-mo when colliding?

    • @przemysawpakua4179
      @przemysawpakua4179 4 года назад +6

      @@maggiethegamer1271
      if (collisionInfo.collider.tag == "Obstacle")
      {
      Time.timeScale = 0.5f;
      }
      else
      {
      Time.timeScale = 1;
      }
      ("Time.timeScale = 0.5f "slows time, in this if it's slows, when hit)

    • @maggiethegamer1271
      @maggiethegamer1271 4 года назад

      @@przemysawpakua4179 looks simple enough.

    • @jindrasyky2354
      @jindrasyky2354 4 года назад +7

      @@przemysawpakua4179 hippity hoppity your code is now my property

    • @maintiax
      @maintiax 3 года назад +1

      @@jindrasyky2354 ctrl C and ctrl V a coders favourite shortkey

  • @itstudent5679
    @itstudent5679 3 года назад +7

    Referencing the game manager other class - 3.00
    Restart the game on game manager - 8:41
    Light problem - 8:56
    delay function - 10:21
    add scene to build setting if more than 1 scene - 11:05

  • @sandrudariusgames411
    @sandrudariusgames411 7 лет назад +148

    What about a shop system where you can buy new textures?

    • @anonymousmeskie5059
      @anonymousmeskie5059 5 лет назад +1

      @@lazyboii735 I've only just found these videos, but I was wondering about that. The other thing I'd like to learn sooner than later is how to program a game to save your progress, so the player doesn't have to start again every time they have to stop playing. I've played games like that and just never completed them.

    • @CottidaeSEA
      @CottidaeSEA 4 года назад

      ​@@anonymousmeskie5059 Just serialize the data and save to a file. www.raywenderlich.com/418-how-to-save-and-load-a-game-in-unity
      SQLite is also an option, which mimics the functionality of SQL within the program/game. Of course, if you don't know shit about SQL, then don't do that as you need to learn about that as well. I'm guessing you don't, so go for the first option. If you go for the JSON route, you'll be able to basically take the data and make it into a text format similar to what you'll find at this site: json.org/example.html
      There are other ways of saving the data, such as in binary format, on a database, etc. However, I'd suggest you go for the JSON route to begin with as it's by far the easiest, as there are many tools out there to help you serialize and deserialize data easily. For example, when I do things in Java, I use the GSON library, which lets me simply write String serialized = new Gson().toJson(object); and I'll serialize whatever that object variable is. Then I can say Object object = new Gson().fromJson(serialized); and my Object there will have the same data as what I started with. Then it's just a matter of saving everything in a logical manner. You likely want to have an object/class that holds your player progress by the way.
      I actually looked around a bit and found this: docs.unity3d.com/ScriptReference/JsonUtility.html
      So there's actually a Json tool already in Unity. Works similar to what I mentioned. JsonUtility.ToJson(obj) or JsonUtility.ToJson(obj, true); to pretty print it, which I'd recommend if you want to read or edit the Json manually later on. It'll create indentations and stuff, whereas the normal one is usually just one line and no spaces. Although I say that due to my experience with other Json tools... including one I made on my own because I was bored one day.

    • @channelemex_private570
      @channelemex_private570 4 года назад +3

      You Sound Like The CEO of EA...

  • @Aye_Sid
    @Aye_Sid 3 года назад +7

    If you have new version unity then lighting is set after GAME OVER is by these steps
    1) click on Window
    2) click on Rendering
    3) click on Lighting
    4) Then click on Generate Lighting which is present in Light Probe Visualization
    5) Done.
    I hope this helps 🙂

    • @hikomore4508
      @hikomore4508 3 года назад

      Hello, can you help me? I have Error:
      NullReferenceException: Object reference not set to an instance of an object
      PlayerCollisions.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/PlayerCollisions.cs:12)

    • @dLzzzgaming
      @dLzzzgaming 3 года назад +1

      Thanks, the UI changed so I was looking for this. Anyone having trouble around 9:30, it's probably this.

    • @Aye_Sid
      @Aye_Sid 3 года назад

      @@hikomore4508 may be u have forgot to attach it into Inspector.

    • @SLIME-gx6fo
      @SLIME-gx6fo 3 года назад

      Thanks man!!

  • @bellobods
    @bellobods 4 года назад +2

    Hey, i wanna say 2 things:
    This tutorial series is amazing!
    When you finish all the tutorials, do it all again so you can remember how the code works etc...

    • @Massive-G
      @Massive-G 4 года назад

      Hey, Felipe can you help?
      After trying everything (5-6 times) by following each and every comment, my "Game Over" text is still not appearing in the console. I think it is happening because in the visual editor "EndGame" isn't showing up.
      PS- Coding and case sensitive scripts are absolutely correct, checked more than 10 times.

    • @bellobods
      @bellobods 4 года назад +1

      @@Massive-G Make sure the visual studio game making tools are ACTIVATED. I had similar problems until i activated it.
      You just open the visual studio installer, go to "modify" in the "more" tab, then you seach for the visual studio game tools, with the unity logo and click "modify" or "install"

    • @beef1043
      @beef1043 3 года назад

      @@bellobods idk why but i have this error "Assets\Scripts\PlayerCollision.cs(13,45): error CS0122: 'GameManager.EndGame()' is inaccessible due to its protection level
      " does anyone know why?

  • @cwsAhShen
    @cwsAhShen 3 года назад +5

    For those watching this video in 2021, just click Generate Lighting and it should work. (for the 9:18 part)

  • @feliscape
    @feliscape 3 года назад +33

    "We also want to show the Game Over message when we fall over the edge"
    Jokes on you.
    I made invisible walls

    • @uopy3775
      @uopy3775 3 года назад

      HOW!!!!!!!!

    • @strahinja1910
      @strahinja1910 3 года назад

      watch it in first ep of this series, it is somewhere on start

    • @totallynothatguy
      @totallynothatguy 2 года назад +1

      @@uopy3775 just make long cubes and delete the mesh renderer

    • @hoyboy6150
      @hoyboy6150 2 года назад

      idk I kind of like the idea that you can fall off the edge, although I don't know which I prefer

  • @namelessyakult.
    @namelessyakult. 4 года назад +2

    watching this 2 hours after brackeys last video we'll never forget you asbjørn thirslund, never 😭

  • @twentyeight602
    @twentyeight602 4 года назад +56

    When you think you did something wrong because you didn't get any errors

    • @bamtamanerjee2620
      @bamtamanerjee2620 4 года назад +2

      1:54
      I made the full code exactly as you made there but when I play it and I hit an object it red marks the
      Line
      - " void OnCollisionEnter (Collision collisionInfo)"
      And Says ! Object reference not set to an instance of an object.
      Please help someone

    • @majesticchicken3213
      @majesticchicken3213 4 года назад

      @@bamtamanerjee2620 try check the obstacle tag..make sure the obstalce tag is set to obstacle in the insceptor

    • @Siduch.
      @Siduch. 4 года назад

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

    • @ruchirrogert.3566
      @ruchirrogert.3566 3 года назад

      @@Siduch. Can you please stop spamming comments. Also, this might be because you tagged the Ground as an Obstacle, that would be the only reason. Untag it, and it should work.

  • @georgiospaschalidis8824
    @georgiospaschalidis8824 3 года назад +3

    If anyone is stuck at Level01 , the reason being you dont have the Level01 scene in your assets or scenes, then go back to video number 1 at 10:27 and you ll get it from there

  • @lfox02
    @lfox02 4 года назад +2

    Man, thanks a lot for these tutorials! A couple hours ago I wanted to make my own game and, though it is a different kind, I have a lot of ideas on how to go about it.

  • @automate4584
    @automate4584 5 лет назад +7

    Those who are struggling to understand the Boolean False and True thing,
    this is as far as i have understood,
    when the player hits its Y axis value of -1f the code will go to "public class GameManager : Monobehaviour" line where the bool gameHasEnded value will be still be set to 'false'
    now it is by default set to 'false' so that when if() checks it (and as the CONDITION is true) it can change the value form 'False' to 'True' and actually end the game.

  • @AnasDeveloper
    @AnasDeveloper 11 месяцев назад +2

    I'm an Egyption
    6 years and you still the best

  • @oak___
    @oak___ 3 года назад +6

    4:14 : When your not getting errors don't worry the tutorial is not outdated and the reason ur not getting errors is because U have already assigned the player to the text and the camera, that's what I think it is.

  • @JoyceW-Art
    @JoyceW-Art 3 года назад +9

    For the lighting issue I couldn't find the button in Unity 2020.3.3f1 to fix the lighting. That is because it's named differently and in a different location
    It's under Lighting > Generate Lighting at the bottom of the panel. It doesn't matter which submenu you have open in Lighting, they all have that button. I clicked Bake Reflection Probes and it fixed the lighting issue for me.

    • @damiwitam8510
      @damiwitam8510 3 года назад +1

      Thanks man just had this issue right now and this fixed it!

    • @codewizz1885
      @codewizz1885 3 года назад

      Hello good sir, when I click Bake Reflection nothing changes, it just goes back to generate lighting, when I click on generate lighting, unity simply crashes :( Could u help me

    • @JoyceW-Art
      @JoyceW-Art 3 года назад

      @@codewizz1885 Ah sorry for the late reply. Sadly I don't know the answer to that question. I haven't really messed with the Bake Reflections either.

  • @RadoHudran
    @RadoHudran 3 года назад

    I'm doing this tutorial now a second time and it's so satisfying getting everything right in 1 go! :D
    The first time it took me about 6 days to complete it now I think I can finish it in one session.

  • @chrisgaming9567
    @chrisgaming9567 3 года назад +5

    Welp, it took 8 episodes but Unity is finally doing something completely different from what's happening on-screen

  • @Dimsense
    @Dimsense 5 лет назад +4

    Hey just wanted to say to make sure to get your positives and negatives the right way round.
    I put 5 instead of -5 and was stuck trying to figure out the problem for 2 and a half hours.

  • @ЭйрикТорвальдссон
    @ЭйрикТорвальдссон 3 года назад +2

    Hey. My Visual Studio doesn't provide me with all these stuff you see when you add some script parts like at 8:10 of this video. It's like VS doesn't understand I'm working in Unity, but I actually downloaded Unity stuff when I was installing VS. What is my problem?

    • @timekr
      @timekr 3 года назад +1

      same happens to me, don't know what to do

  • @danielle9803
    @danielle9803 4 года назад +4

    9:16 I couldn't find the Auto Lightmap Baker in the new Lighting Settings Unity has.
    Did it make a big difference for you guys?

  • @timmylol6
    @timmylol6 4 года назад +3

    If you get a NullReferenceException on 8:50 then you might forget to add the GameManager script to the GameManager object in unity. This is how I solved theproblem

    • @Ll4manator
      @Ll4manator 4 года назад +1

      Thank you so much. I don't know how I missed that, I thought I had created the GameManager Object but apparently I didn't.

    • @mateuszsieraszewski7666
      @mateuszsieraszewski7666 4 года назад +1

      OMG thank you so much bro, that really helped me.

    • @Gamer_OP6009
      @Gamer_OP6009 3 месяца назад +1

      i got the same problem and I fixed it by myself and now I see this comment

  • @darshcodez286
    @darshcodez286 3 года назад +2

    Not to worry, at 4:20, it normal NOT to get the error. ( Brackeys got a error because he had remove the player earlier in the video for demonstration :)

  • @aniketd7495
    @aniketd7495 6 лет назад +15

    I have an error ..... HELP
    Assets/Scripts/PlayerCollision.cs(11,22): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

    • @ChrisField13
      @ChrisField13 6 лет назад +27

      Same here, but I found a comment below that helped me fix it. Just make sure to include parenthesis after both AND EndGame.

    • @shreyanshanchlia
      @shreyanshanchlia 6 лет назад +4

      Chris Field thanx problem solved
      Had the same problem here

    • @Adomas_B
      @Adomas_B 5 лет назад

      @@ChrisField13 thank you i was stuck at this for half an hour

    • @deepshekhar2209
      @deepshekhar2209 4 года назад

      @@ChrisField13 thanks man i was stuck at this for about 1.5hour

    • @dbneptune
      @dbneptune 4 года назад

      @@ChrisField13 Thank god you exist

  • @AlexVoda14
    @AlexVoda14 4 года назад +5

    I have 2 questions :D
    why wont my visual studio color all the words like his and why it wont show me all the things it shows to him like it did at 3:28 ?

    • @almuhimen8023
      @almuhimen8023 4 года назад +2

      It's because he is using intellisense for c# and probably you don't.

    • @Tiikers
      @Tiikers 4 года назад +2

      Most likely you don't have Visual Studio Tools for Unity installed or enabled for Visual Studio.
      Go to Visual Studio installer and install the Visual Studio Tools for Unity on your version of Visual Studio.
      After that go Visual Studio. Click Edit --> Preferences --> External Tools. On the External Script Editor drop down menu, change that to Visual Studio 2019.

    • @joepleavin3554
      @joepleavin3554 4 года назад

      @@Tiikers Love you. x

  • @TheWizard991
    @TheWizard991 2 года назад

    These videos are pure gold. I've made a game called Jumpy Cube.

  • @MxArcher
    @MxArcher 3 года назад +9

    For the current build of unity (v.2019.4.20f1) I was still getting the lighting issue even though the 'Auto' checkbox (now 'Auto Generate') was already unticked. I solved it by clicking the 'Generate Lighting' button next to it. Don't click the arrow - that will just open a drop-down menu - click the text. It will render for a moment, then it won't cause the lighting bug again. At least, it hasn't for me so far for the current scene.

    • @Joemanf
      @Joemanf 3 года назад

      This actually saved me a huge headache. You're a hero

    • @sync816
      @sync816 3 года назад

      Same
      thx so much for this

    • @simonflodin5109
      @simonflodin5109 3 года назад

      you're the best

  • @JazzaManga
    @JazzaManga 4 года назад +7

    i’m pretty sure i’ve got everything correct for the first 4-5 mins of the vid but for some reason the debug.log doesn’t show up in the console when i collide and i have no idea why, any help?

    • @keary3757
      @keary3757 4 года назад

      try UnityEngine.Debug.log instead

  • @brucelee7782
    @brucelee7782 3 года назад +1

    1:45 why does assigning a script to an object makes it a "type"? If I did not insert the script the FindObjectOfType method doesn't work

  • @citizengoose1342
    @citizengoose1342 5 лет назад +8

    1:19 avengers 4 title confirmed 2 years ago

  • @jovem3767
    @jovem3767 3 года назад +3

    Hello everyone. If you're getting mess with finding the *Player* to dont use a variable I will show you how to do.
    Use the: GameObject.Find("The name of the object that youre wanting to find inside the quotation marks, in the case, Player") and then you can put a dot(.) to access the info about that object. Like:
    GameObject.Find("Player").transform.position.z.toString("0");
    The GameObject.Find("Something Here") is very useful to find an object by name(and only for this too).
    So you only need to put the name of the object inside quotation marks.

  • @Александр-р3э3м
    @Александр-р3э3м 4 года назад

    Your tutors are the best i've seen! I didnt know anything, but your tutors helped me! Thank you so much!)

  • @EdwinCreatives
    @EdwinCreatives 5 лет назад +12

    Hey Brackeys! How do you add a restart panel and restart the game with buttoninstead of restart instantly?
    Please let me know

    • @sciender440
      @sciender440 3 года назад +1

      You would most likely use the same code, just instead of running it when you collide with an obstacle/game over, have the code run when you press whatever button you want, assuming you mean a key on the keyboard, instead of a GUI that pops up when the game ends. For the former, just do the same type of thing you did for moving left and right, just modify the body of the code(code within the curly brackets). Not entirely sure how to do the latter.

    • @EdwinCreatives
      @EdwinCreatives 3 года назад +1

      Understand :) Thanks for the help after 2 years of waiting for answers!

  • @ПешоУзунов
    @ПешоУзунов 3 года назад +3

    If someone on 10:50 gets error, local function "Restart" is declared but never used, don't search in the web, maybe you just miss placed { } because that's what I did and I was wondering what's wrong about 20 mins before I start checking every word with his. I'm using C# from 3 days and it was like hell for me to find this little }

    • @sparkeee3
      @sparkeee3 3 года назад

      I grabbed the script itself that he had left on his website but it still says that, do you think you could share your code with us?

    • @ПешоУзунов
      @ПешоУзунов 3 года назад

      @@sparkeee3 sorry bro i have started javascript bcs it seemed easier and my friends told me that, and I deleted my C# codes

  • @LUMINA3
    @LUMINA3 4 года назад +2

    but i did not receive any errors as mentioned in 4:18
    *edit: oh i did not do the prefab lol nvm pls no answer*

  • @hriday684
    @hriday684 4 года назад +5

    I think Unity did change something in its new version this time - I didn't turn off the auto lighting, but it was still working fine!

  • @adamlee4650
    @adamlee4650 7 лет назад +11

    Every time I test the game a couple of times, it gives me some errors, saying "Invalid parameter pos in Rigidbody. TransformChanged because it was infinite or NaN", "Invalid AABB aabb", "Assertion failed on expression: 'IsFinite(d)' " etc.
    (Also, even though the code seems right, the "a" and "d" key doesn't seem to work...)

    • @Cmad1202
      @Cmad1202 7 лет назад +1

      I have the exact same error. Did you find a fix?

    • @adamlee4650
      @adamlee4650 7 лет назад +1

      Nope...

    • @funamusic
      @funamusic 7 лет назад +2

      I know this comment is old but, i might have a fix for the "a" and "d" key not working. If you are in fullscreen when testing then (atleast i have to) you have to click on the scene after you press play in order to interact with it.
      I hope this helped :P although you are probably not concerned with this anymore lol

    • @CandorZofain
      @CandorZofain 6 лет назад +3

      For the error: Edit > Project Settings > Physics.
      Change "Contacts Generation" from "Persistent Contact Manifold" to "Legacy Contacts Generation"

    • @FurryDanOriginal
      @FurryDanOriginal 6 лет назад +1

      @@CandorZofain Thanks a lot! It works

  • @slavcabbage2619
    @slavcabbage2619 4 года назад

    If your game isn't restarting some major scene tips to fix are
    1: make sure your script is named GameManager (IDK if it works for you but it worked for me and yes I had the settings symbol)
    2: make sure you made the empty component in the Hierarchy (tab on the left side of the editor) and call it GameManager caps sensitive, no spaces, and very important (why I had problems)
    3: If all else fails close and reopen Visual Studio even if there are no errors that are apparent

  • @coreychase1830
    @coreychase1830 7 лет назад +21

    @Brackeys Hey could you make a start and pause GUI. Or maybe a colour select menu. Just my ideas

    • @sentientringoffire7658
      @sentientringoffire7658 7 лет назад

      This isn't twitter you don't use the "@".

    • @yesveryprofesionalnameyes6055
      @yesveryprofesionalnameyes6055 6 лет назад +1

      i think it then sends that message to Brackeys..
      i think....

    • @Aanannanan
      @Aanannanan 5 лет назад

      @@sentientringoffire7658 RUclips used to notify when you use @ to refer to someone, today i think you need to use +.

    • @SwainCountry
      @SwainCountry 5 лет назад

      +Brackeys Read the main message please

    • @ImplyDoods
      @ImplyDoods 4 года назад

      @@sentientringoffire7658 actualy you do

  • @AllofTheGame
    @AllofTheGame 7 лет назад +30

    I'm not getting any errors but I cannot get the game over to show in the console. I'm not sure what I'm doing wrong.

    • @photoshopsuraj
      @photoshopsuraj 6 лет назад

      Facing Same Problem Someone Please help us!

    • @benjaminmehl8951
      @benjaminmehl8951 6 лет назад

      @@photoshopsuraj me too

    • @hardcoregaming2807
      @hardcoregaming2807 6 лет назад +1

      Did you spell Debug.Log(); correctly?

    • @justbenner9772
      @justbenner9772 5 лет назад +1

      Try print() and the thing you want the console to say in ""

    • @redkaribou8102
      @redkaribou8102 5 лет назад

      Check if the debug.log works on another fonction and check if you are locking the right console

  • @nikolasbabetas3490
    @nikolasbabetas3490 4 года назад +2

    I made on my own an invisible barrier at both sides of the ground which also does not have any friction. I know it is not a lot but i am pretty satisfied with myself ;)

  • @jino_0153
    @jino_0153 4 года назад +8

    I don’t know what is happening but when my player hits a obstacle it doesn’t reset. The coding is exactly the same... someone help! D:

    • @muhammadmohsen8732
      @muhammadmohsen8732 4 года назад

      you can check this tutorial out , i think it can help you : ruclips.net/video/2bE0ubwWzhY/видео.html

    • @Sam-rv3ew
      @Sam-rv3ew 4 года назад

      Yeah it’s the same for me

    • @jone6135
      @jone6135 4 года назад

      Same here

    • @andreirotariu2492
      @andreirotariu2492 4 года назад

      Make sure you didnt put the definition of Restart() method inside of the public void EndGame () function. It should be outside public void EndGame () function brackets. Hope this helps even its a late reply :)

  • @maggiethegamer1271
    @maggiethegamer1271 4 года назад +3

    Guys, if your ground is for some reason lower than the grid, change the rb.position to be BELOW your ground, or else you will game over when starting the game. (Remember, when working with minus numbers, the value goes higher as you go lower, but you probably know, I just wanted to clear this up.)

  • @johnland8372
    @johnland8372 6 лет назад +4

    Okay so i have some main errors that i don't know how to fix, after finishing at 8:50
    1- All compiler errors have to be fixed before you can enter playmode!
    UnityEditor.SceneView:ShowCompileErrorNotification()
    2- All compiler errors have to be fixed before you can enter playmode!
    UnityEditor.SceneView:ShowCompileErrorNotification()
    3- Assets/GameManage.cs(21,10): error CS1547: Keyword `void' cannot be used in this context
    4- Assets/GameManage.cs(21,22): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
    5-Assets/GameManage.cs(31,0): error CS1525: Unexpected symbol `}'
    Please help.

    • @94D33M
      @94D33M 6 лет назад

      Did you forget to add the brackets properly ? that is the () ? i think i had a similar problem but realised I was missing brackets, btw did you fix the problem ?

    • @johnland8372
      @johnland8372 6 лет назад

      @@94D33M i just tried going back with the video and everything was the same thing he did.

    • @94D33M
      @94D33M 6 лет назад +1

      @@johnland8372 paste your gamemanage.cs code

    • @jasperkoppelaar1635
      @jasperkoppelaar1635 6 лет назад

      hey, i found the fix to error 3, the: void Restart()
      { SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
      is inside the: public void EndGame()
      {
      if (gameHasEnded == false)
      {
      gameHasEnded = true;
      Debug.Log("GAME OVER!");
      Invoke("Restart", restartDelay);
      }
      }
      code. if you replace the curly brackets so that the void Retart() is outside of the endgame code its fixed

    • @jasperkoppelaar1635
      @jasperkoppelaar1635 6 лет назад +1

      @@goran5844 lmao

  • @Askejm
    @Askejm 6 лет назад +7

    NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO Unity crashed when i tried the test and the errors came at 4:10 so i had to start over again ;-;

  • @markster3815
    @markster3815 4 года назад +1

    PLEASE HELP! at 5:28 you typed if (rb.position...
    I typed that and it says rb does not exist so I used renderbuffer becaze it recomended it to me but then there is an error that says I need to type a definition or position Idk something I think its becaze Im doing this in 2020 and things changed could you do an updated version of respawning?
    edit: and I checked all of my scripting if it was right and it was

    • @muhammadmohsen8732
      @muhammadmohsen8732 4 года назад

      check this tutorial out , i think it can help : ruclips.net/video/2bE0ubwWzhY/видео.html

  • @ElmoPlayss
    @ElmoPlayss 4 года назад +4

    Don't mind me just telling myself where to continue from next time :)
    5:30

  • @Sigmaop2278
    @Sigmaop2278 6 лет назад +5

    I Have An Error
    He Says SceneManagement are not exist in your namespace 'unity engine' Are You Missing an Assembly reference?
    Please Help Me

    • @Itz_Jorge
      @Itz_Jorge 5 лет назад

      Have u figured out

    • @99shafan99
      @99shafan99 5 лет назад +3

      Check if you have some of the script files in the Assets folder as well as in the scripts folder.
      If so, make sure the ones in the Scripts folder are updated and delete the ones in the Assets folder.
      This might have happened if you had the scripts open while moving them to the Scripts folder.
      It worked for me, hope it worked for you :)

  • @macauleysmith3472
    @macauleysmith3472 4 года назад

    I got to 8:57, but when I pressed play I just died over and over again instantly and the console was spamming game over, I re-followed the whole video TWICE, pausing all the way through and checking over my code, thinking I'm going crazy, turns out I missed a pair of {curly brackets} , I hate myself.
    But seriously great tutorials, thank you for these free resources, I'm having fun learning all this :D

  • @mrfinnerty06
    @mrfinnerty06 4 года назад +11

    me: so ive made a small level
    also me: looks at the number of objects, sees 410
    OH MY G

    • @Skullton03
      @Skullton03 4 года назад

      Lol ikr, level 20 be like *number of objects: 12,390*

    • @Siduch.
      @Siduch. 4 года назад

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

    • @magicle855
      @magicle855 3 года назад

      @@Siduch. change this line from if (rb.position.y < -1f) to if (rb.position.y < -0.5f)

  • @BananaLlama
    @BananaLlama 7 лет назад +6

    Brackeys plz help, it says
    The type or namespace name 'GameManager' could not be found (are you missing a using directive or an assembly reference?)
    Edit: it works in GameManager script but not player movement.

    • @llennow2535
      @llennow2535 7 лет назад +3

      Banana Llama how did you fix it? I have the same problem

    • @eralpcelebi3216
      @eralpcelebi3216 7 лет назад +2

      I got the same error

    • @eralpcelebi3216
      @eralpcelebi3216 7 лет назад +3

      I solved it by renaming the script and changing FindObject type from FindObjectType to FindObjectType

    • @BananaLlama
      @BananaLlama 7 лет назад +1

      Eralp Çelebi it still won't work.

    • @seth7864
      @seth7864 7 лет назад +1

      Thx This Worked well

  • @Danozziiii
    @Danozziiii Год назад

    Brackeys = God of coding
    Tutorials

  • @adobeco
    @adobeco 4 года назад +6

    I just realized how close of a resemblance my profile picture and brackeys has lol

  • @krank3869
    @krank3869 7 лет назад +17

    Mine starts losing everytime i start the game.
    help?

    • @sskatin7878
      @sskatin7878 7 лет назад

      Same

    • @severilybeck
      @severilybeck 7 лет назад +5

      Sorry for the late reply, but check if your player y position is over 1 because if it is you will lose.

    • @Red_The_Duck
      @Red_The_Duck 7 лет назад +1

      It's because for unity is a collision when the player touch the ground

    • @titoguidotti2397
      @titoguidotti2397 7 лет назад

      Use Debug.Log to locate the problem

    • @jumkmayl7914
      @jumkmayl7914 6 лет назад

      SAME PLEASE HELP!

  • @CmFive
    @CmFive 5 лет назад +4

    Anybody know how to help me? My error is: "error CS0246: The type or namespace name `MySystem' Could not be found.
    Are you missing a using directive of assembly reference?" I have all the code correct, but it's not working. Anybody know how to fix it?

    • @rohandevadas1141
      @rohandevadas1141 4 года назад

      You might of spelled something wrong bc that's what I did and I fixed it and it went away

  • @LordOfLemon
    @LordOfLemon 7 лет назад +5

    I have a weird bug where if I ride against the wall of my ground and the player touches the bottom edge, the player cube disappears and the z-coordinate (thus the score) becomes NaN.

    • @CandorZofain
      @CandorZofain 6 лет назад +1

      There's a bug where when an object rotates on the edge of another object the former moves to {NaN, NaN, NaN}
      To fix the error: Edit > Project Settings > Physics.
      Change "Contacts Generation" from "Persistent Contact Manifold" to "Legacy Contacts Generation"

    • @HisBelovedSon70x7
      @HisBelovedSon70x7 6 лет назад

      Perfect, that fix worked for me, thank you. What exactly does this change mean? Does Unity check physical contact incrementally now instead of consistently?

    • @CandorZofain
      @CandorZofain 6 лет назад +1

      IDK, I just Googled for a potential solution and found that.
      But I did a quick search and found this: docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/AdvancedCollisionDetection.html#persistent-contact-manifold-pcm

  • @ScilexGuitar
    @ScilexGuitar 4 года назад +1

    I made the obstacles spawn randomly as the player moved forward. Pretty fun!

  • @thenicesven5328
    @thenicesven5328 4 года назад +16

    "We probably geting some Errors"
    Danm i didnt get one does this make me good or bad because i somehow messed up but it worked for me?

    • @mumpreneurcollective8270
      @mumpreneurcollective8270 4 года назад +1

      same

    • @bamtamanerjee2620
      @bamtamanerjee2620 4 года назад

      1:54
      I made the full code exactly as you made there but when I play it and I hit an object it red marks the
      Line
      - " void OnCollisionEnter (Collision collisionInfo)"
      And Says ! Object reference not set to an instance of an object.
      Please help someone

  • @soulsiv4292
    @soulsiv4292 4 года назад +64

    is it only me who takes 2 hours for every tutorial trying to fix grammers ?

    • @cblnks
      @cblnks 4 года назад +11

      Grammar*

    • @lance3529
      @lance3529 4 года назад +2

      Tab = auto fill/ auto correct

    • @Dimtree669
      @Dimtree669 4 года назад

      yes

    • @Siduch.
      @Siduch. 4 года назад

      Anyone know why it ends game as soon as game starts. In a previous video, where Brackeys told us how to make the object slow down only when it hits an obstacle, I copied and did exactly what he said and it worked.
      Someone plz EXPLAIN TO ME WHY THE GAME ENDS RIGHT WHEN I PRESS PLAY!!!!????

  • @tomas3067
    @tomas3067 4 года назад

    Hi, i don't understand. Obviously i made a mistake. 4:17 i set my camera to follow my player and player on text as well. But then i wanted to try the game but the camera just flew up and player went his way. What's the problem? I hope you will answer. Thank you anyway.

  • @gaizka3769
    @gaizka3769 7 лет назад +5

    Hello! I have one question. Why when I'm playing and i put my cube in the left lateral my score position of the cube is replaced by "NaN". thaks!!!! :)

    • @Yogman444
      @Yogman444 7 лет назад

      This stands for "Not a Number" which means for some reason your variable is not a float or int

    • @CandorZofain
      @CandorZofain 6 лет назад +2

      There's a bug where when an object rotates on the edge of another object the former moves to {NaN, NaN, NaN}
      To fix the error: Edit > Project Settings > Physics.
      Change "Contacts Generation" from "Persistent Contact Manifold" to "Legacy Contacts Generation"

    • @sebastianrijks4959
      @sebastianrijks4959 6 лет назад

      Yes, this finally fixed it for me!

  • @the_goldendragon9158
    @the_goldendragon9158 5 лет назад +13

    i dont think there is game manager is 2019.2!

    • @caiogamer2723
      @caiogamer2723 5 лет назад +4

      You need to make a script named GameManager, and thats the same name you need to set it to

    • @johncasper9522
      @johncasper9522 4 года назад

      That was a chosen variable name, not a reserved keyword for anything.

  • @Xikiea
    @Xikiea 3 года назад +1

    Another way to make a game over when you fall off the edge is to create 2 copies of the obstacle, scale them to the same scale as the ground except x, which should be 0.01, set the location to 0.01 +(positive x) or -(negative x) half the x scale of the ground ,and disable the mesh render.

  • @somabencsik
    @somabencsik 7 лет назад +6

    Thank you for this video!
    If the game is over, how can I change the number which is in the middle of the screen to "Game Over" or "Press 'R' to restart"

    • @Brackeys
      @Brackeys  7 лет назад +4

      You can change the text by getting a reference to the Text Component - Let's call that myText and then writing myText.text = "Game Over";

    • @somabencsik
      @somabencsik 7 лет назад

      Brackeys Thank you very much! I love your videos :-)

    • @somabencsik
      @somabencsik 7 лет назад

      Sorry, I thought i can do this but i do not understand something. How can i get the reference to the Text Component? Because the FindObjectOfType is not working, please help :)

    • @Conf1dential_
      @Conf1dential_ 2 года назад

      @@somabencsik Use GetComponent
      sorry for the late reply I didn't realise tht

  • @mmixyyy5939
    @mmixyyy5939 7 лет назад +16

    Can u show to all how to create "Finish Level" and then this,show text "Good job!!" ?Like if u want this!

  • @YoloMasterGamerTag
    @YoloMasterGamerTag 4 года назад

    i have reached this video from video on and it has taken me 52h to get it all right cause of grammers or point blank things and now i am stuck at the restard section XD another 2hours to just find something so simple XD lord i love this

  • @ChiefyChieferton
    @ChiefyChieferton 4 года назад +11

    Here's something that might be helpful to everyone: Include a line of code at the very top which says this:
    using Debug = UnityEngine.Debug;
    I ran into a situation where Unity kept giving an error for Debug.Log because the code didn't explicitly say that it was for debugging things in Unity, or something like that.