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

Поделиться
HTML-код
  • Опубликовано: 27 мар 2024
  • What happens when we lose?
    ● Download the Project Files: devassets.com/assets/how-to-ma...
    ♥ Support my videos on Patreon: / brackeys
    ····················································································
    This video is part of a mini-series on making your first game in Unity.
    ····················································································
    ♥ Donate: brackeys.com/donate/
    ♥ Subscribe: bit.ly/1kMekJV
    ● Website: brackeys.com/
    ● Facebook: / brackeys
    ● Twitter: / brackeystweet
    ········································­­·······································­·­····
    Edited by the lovely Sofibab.
    ········································­­·······································­·­····
    ► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.
    ········································­­·······································­·­····
    ♪ Baby Plays Electro Games
    teknoaxe.com/cgi-bin/link_code...

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

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

    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 ...

    • @user-ul6uf7wb6v
      @user-ul6uf7wb6v 7 лет назад +11

      I want to translate your videos from English to Arabic.

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

      Brackeys Awesome!

    • @diegocrusius
      @diegocrusius 6 лет назад +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.

  • @TheNewYouTubeHandlesAreDumb
    @TheNewYouTubeHandlesAreDumb 3 года назад +1754

    Which is scarier? Getting an error when the tutorial doesn't, or not getting an error when the tutorial does?

    • @sirgarde9256
      @sirgarde9256 3 года назад +345

      The second one by far. The first one i'd assume i made a mistake, the second i'd assume the tutorial is outdated and panic.

    • @TheHappyCatsTail
      @TheHappyCatsTail 3 года назад +40

      yeah i got this when brackys went to add the thing about the game over only happening once, mine already did only end once and my code was EXACTLY like in the video. i think something musta updated in unity in the time this came out.

    • @waterfan3399
      @waterfan3399 3 года назад +24

      of course, when we get errors and tutorial doesn't

    • @h-0058
      @h-0058 3 года назад +34

      The second one 100%
      If I get an error that shouldn't be there, I can just work around it, knowing that there is a solution. However, if I don't get an error when I should, then... *panik*

    • @PattyCali
      @PattyCali 3 года назад +16

      this 12 min video took me an hour and 30 to finish. I got error after error lmao. but we finished! onto the next :)

  • @timsonss
    @timsonss 3 года назад +381

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

    • @Siduch.
      @Siduch. 3 года назад +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 года назад +24

      But he's not dead

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

      😭😭

    • @user-rf5jb4go9i
      @user-rf5jb4go9i 2 года назад +1

      no way wtf

    • @user-rf5jb4go9i
      @user-rf5jb4go9i 2 года назад +13

      you scared me so much damn i thought he died

  • @ant1bliss
    @ant1bliss 2 года назад +38

    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!

  • @MoreST6
    @MoreST6 5 лет назад +916

    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 5 лет назад +11

      Ya Boi Starmix Oh, the irony!

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

      Ya Boi Starmix (*Sleep)

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

      SPELL*

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

      @@MoreST6 That's it! 👏👏👏

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

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

  • @99shafan99
    @99shafan99 4 года назад +709

    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 :)

  • @prefixn5677
    @prefixn5677 Год назад +7

    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.

  • @CreeperPowerstoring
    @CreeperPowerstoring 4 года назад +153

    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 3 года назад +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 3 года назад +3

      Same

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

      Yet my other scripts look like a # symbol

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

      @@daring7495 yeah lol

  • @MrAydinminer
    @MrAydinminer 4 года назад +967

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

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

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

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

      right...

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

      ...

    • @LetsDrinkWindex
      @LetsDrinkWindex 3 года назад +16

      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 3 года назад

      @@LetsDrinkWindex XD I knew what u meant lol

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

      ew

  • @anigamerisgaming3110
    @anigamerisgaming3110 Год назад +18

    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 2 месяца назад

      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?

  • @moahammad1mohammad
    @moahammad1mohammad 3 года назад +105

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

  • @drfurbz
    @drfurbz 4 года назад +118

    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 4 года назад +3

      i am not sure if i understand it

    • @fahadaameer5618
      @fahadaameer5618 4 года назад +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 3 года назад

      @@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

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

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

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

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

  • @outhen
    @outhen Год назад +10

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

  • @EdwinCreatives
    @EdwinCreatives 4 года назад +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 2 года назад +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 2 года назад +1

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

  • @feasiblepi8373
    @feasiblepi8373 5 лет назад +158

    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 4 года назад +1

      r/IHaveReddit

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

      this is not reddit mate

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

      @@PurplySkye fail

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

      appreci8 it m8

    • @Siduch.
      @Siduch. 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!!!!????

  • @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!

  • @mikeydlad00
    @mikeydlad00 3 года назад +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 9 месяцев назад +4

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

    • @tadakuniyasuda8214
      @tadakuniyasuda8214 9 месяцев назад

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

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

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

    • @AndrewQuinlan-or9dd
      @AndrewQuinlan-or9dd 8 месяцев назад

      Thanks man

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

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

  • @jedifiter23
    @jedifiter23 2 года назад +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

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

    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..

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

    Ive got to the movment script where we add
    if (rb.position.y < -1f)
    {
    FindObjectOfType().EndGame();
    }
    And there is some ERROR that I cant figure out why it comes. I watched the part where he puts in the code and I looked in mine to see if something is wrong but nothing really was so I downloaded his script and copy-pasted it but it continues showing me an error. WHY?

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

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

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

      raniaska only an hour 😂

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

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

    • @Siduch.
      @Siduch. 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!!!!????

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

      those are rookie numbers

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

      impossible

  • @JazzaManga
    @JazzaManga 3 года назад +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 3 года назад

      try UnityEngine.Debug.log instead

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

    Assets\Scripts\playercollision.cs(16,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
    any help?

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

    Hi, i have this problem, please help me.
    NullReferenceException: Object reference not set to an instance of an object
    PlayerCollisions.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/PlayerCollisions.cs:12)

  • @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 6 лет назад

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

    • @candorzofain8682
      @candorzofain8682 5 лет назад +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 5 лет назад

      Yes, this finally fixed it for me!

  • @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 5 лет назад +4

      Chris Field thanx problem solved
      Had the same problem here

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

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

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

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

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

      @@ChrisField13 Thank god you exist

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

    i get this error after trying to enable restart
    Assets\GameManager.cs(22,62): error CS1061 : 'Scene' doesn not contain a definition for 'Name' accepting a first argument of type 'scene' could be found (are you missing a using directive or an assembly reference?)

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

    NullReferenceException: Object reference not set to an instance of an object
    PlayerCollision.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/Scripturi/PlayerCollision.cs:15)
    what can i do?

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

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

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

      HOW!!!!!!!!

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

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

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

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

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

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

  • @przemysawpakua4179
    @przemysawpakua4179 3 года назад +10

    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 3 года назад +1

      how do you get slo-mo when colliding?

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

      @@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 3 года назад

      @@przemysawpakua4179 looks simple enough.

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

      @@przemysawpakua4179 hippity hoppity your code is now my property

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

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

  • @animeheat9230
    @animeheat9230 3 года назад +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

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

    Hey, so I've noticed that visual studio won't give me the suggestions/show me what I can do with the variables, nor do the objects show up in orange text. I am using Unity 2020.3.11f1 Personal and Visual Studio 2019. I do have (using UnityEngine;), ignore the (), at the top. Any idea as to why this is happening?

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

      Found the problem, I had to go to unity, edit > preferences > external tools, and select Visual Studio under External Script Editor. If Visual Studio is giving you the error that Assembly-CSharp is incompatible, right-clicking the assembly then pressing reload with dependencies worked for me.

  • @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 6 лет назад +1

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

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

      Nope...

    • @funamusic
      @funamusic 6 лет назад +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

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

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

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

      @@candorzofain8682 Thanks a lot! It works

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

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

    • @Siduch.
      @Siduch. 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!!!!????

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

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

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

      12 time lmao and I’ve finished everything besides this

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

    please help im having this error
    NullReferenceException: Object reference not set to an instance of an object
    PlayerCollision.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/PlayerCollision.cs:15)

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

    It keeps saying this error NullReferenceException: Object reference not set to an instance of an object
    Cube_Collision.OnCollisionEnter (UnityEngine.Collision collisionInfo)
    Because of something in my Player collision script. Please help.

  • @CmFive
    @CmFive 4 года назад +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

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

    how do i fix this brackeys? ''NullReferenceException: Object reference not set to an instance of an object
    playercolllision.OnCollisionEnter (UnityEngine.Collision collisioninfo) (at Assets/running cube script/playercolllision.cs:12)''

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

      I have the same error.

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

      Nugroho Pangestu rewrite the script brother

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

      That's not helpful in the slightest, how about you actually give a real solution. +DragonSlayer98

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

      Is this problem in accordance to disabling the movement after colliding with an obstacle? What are you trying to do; and what is not working?

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

      If anyone is going through this tutorial and getting this error like i was the problem for me was i was using
      GetComponent().EndGame()
      instead of the correct
      FindObjectOfType().EndGame()

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

    can someone help me pls
    Assets\Scripts\PlayerColision.cs(13,45): error CS1061: 'GameManager' does not contain a definition for 'EndGame' and no accessible extension method 'EndGame' accepting a first argument of type 'GameManager' could be found (are you missing a using directive or an assembly reference?)

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

    why does mine says "'PlayerMovement' does not contain a definition for 'position' and no accessible extension method 'position' accepting a first argument of type 'PlayerMovement' could be found (are you missing a using directive or an assembly reference?)"

  • @xjockyxx
    @xjockyxx 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 3 года назад +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 3 года назад

      @@Tiikers Love you. x

  • @bamtamanerjee2620
    @bamtamanerjee2620 3 года назад +12

    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.

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

      mine too

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

      this happened to me and I'm so confused so I went to the comments for a fix lol

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

      @@arasaan If this error comes then it means that there is no problem in coding . Just make sure you have put the coding to the player . Sometimes you write the coding but there is no one effected bcuz you need to deliver it tk any object

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

      @@Namanj07 I deleted everything I made from the tutorial and remade it and it works fine

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

      @@arasaan cool

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

    how do i get visual studio so it shows the stuff that the certain functions can do, because mine doesn't show that stuff like in the video

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

    Can't seem to get "LoadNextScene" function in my animation event drop down list, although already specified the function in visual studio.

  • @Sigmaop2278
    @Sigmaop2278 5 лет назад +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 4 года назад

      Have u figured out

    • @99shafan99
      @99shafan99 4 года назад +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 :)

  • @lynxunderscore6569
    @lynxunderscore6569 2 года назад +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.

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

    Hi I am having issues with the reset
    FindObjectOfType().endgame();
    this is the code I am using
    this is the errror
    Assets\oncollide.cs(8,29): error CS0246: The type or namespace name 'Endgamer' could not be found (are you missing a using directive or an assembly reference?)
    Also what extension do you use for vscode as I dont get any refrences to the available functions. Please help

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

      fyi you wrote endgameR with an R at the end

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

      @@masamotox952 Thanks for the reply MasamotoX :) I will update my code

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

      @@Jmonitcom fyi this will also fix your suggestions stuff ruclips.net/video/5LX13Xqc50g/видео.html

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

      The references

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

    Assets\scripts\pang.cs(15,30): error CS0246: The type or namespace name 'GameManager' could not be found (are you missing a using directive or an assembly reference?)

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

    Hey guys, can anyone help me? I have Unity 5.6 but Visual Studio isn't using Intellisense or auto-complete on my code, it also doesn't highlight it like in this video. It's set up in the Preferences tab and the Build Settings, and I've also imported the package inside Unity itself, but it's simply not working.

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

    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.

  • @user-fq4lt6hp7l
    @user-fq4lt6hp7l 2 года назад +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 2 года назад +1

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

  • @tamirrozenfeld3572
    @tamirrozenfeld3572 Год назад +2

    i get this issue "Trying to Invoke method: GameManager.Restart couldn't be called" delay function doesn'tt work, any help ?
    Edit:
    fixed it, "void Restart ()" was inside End Game function accidentally.

  • @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?

  • @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 7 месяцев назад

      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.

  • @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.

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

    Hi what plugin do you use for VSCode? Because it does not show me all these options when i type words

  • @froggot7057
    @froggot7057 5 лет назад +265

    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 4 года назад +14

      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 4 года назад +21

      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 4 года назад +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 4 года назад +4

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

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

      amelie rose np lol

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

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

    • @anonymousmeskie5059
      @anonymousmeskie5059 4 года назад +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 3 года назад +3

      You Sound Like The CEO of EA...

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

    at 4:06 I got this error can someone help me please?
    Assets\scripts\PlayerCollision.cs(13,45): error CS1061: 'GameManager' does not contain a definition for 'EndGame' and no accessible extension method 'EndGame' accepting a first argument of type 'GameManager' could be found (are you missing a using directive or an assembly reference?)

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

    question: @05:27
    Why do we use rb.position? Surely we should use the Transform right? I cant even see a position on the RigidBody Component, its all just speeds.
    It works, but im confused. Anyone care to explain?

  • @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.

    • @domdumm3885
      @domdumm3885 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 6 лет назад +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 6 лет назад +1

      Same problem here. Also looking for a fix.

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

    I get Assets/scrp/collision.cs(12,38): error CS1061: Type `gamemanager[]' does not contain a definition for `EndGame' and no extension method `EndGame' of type `gamemanager[]' could be found. Are you missing an assembly reference? if anyone can solve this please

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

      Same here, did u find a fix??

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

      Make sure you copy his script perfectly. Missing a semi colon? ;;;;;;

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

      im sure I've copied his exactly just is still giving a error

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

      Do you have all the correct } in the game manager script?

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

      I also have that problem

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

    after i added the thing to the collision script, i got this error "Assets\GameManager.cs(3,7): error CS0116: A namespace cannot directly contain members such as fields or methods
    ", what do i do?

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

    The type or namespace name 'GameManager' could not be found (are you missing a using directive or an assembly reference?)
    I got this error and cannot figure out how to fix it. My object in unity IS called GameManager. Theres no typos.
    If I change the variable type to something else, like int, the console error will go away. But then I also cannot drag my GameManager object to the variable in Unity.

  • @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_ Год назад

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

  • @adrianherralgot4071
    @adrianherralgot4071 4 года назад +50

    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 4 года назад +2

      Pls help me :'(

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

      Sammmeeee

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

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

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

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

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

      Just look around until you fix it

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

    @Brackeys In Microsoft Visual Studio I dont get a drop down box like you get after putting a "." after any certain command.. Pls give any solution for it ..

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

    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.

  • @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.

  • @BananaLlama
    @BananaLlama 6 лет назад +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 6 лет назад +3

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

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

      I got the same error

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

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

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

      Eralp Çelebi it still won't work.

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

      Thx This Worked well

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

    Hey I dont have a player collision script because im trying to implement this in a 2d project with 2d collision boxes. Is there an alternative way i can do this? Please help...

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

    can you please tell me why thats not working and why i get this error NullReferenceException: Object reference not set to an instance of an object
    PlayerCollision.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/Scripts/PlayerCollision.cs:15)

  • @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!

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

    I have this problem when I hit an object it says this. instead of game over I have done everything to 4:51
    NullReferenceException: Object reference not set to an instance of an object
    PlayerCollision.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/Scripts/PlayerCollision.cs:12)

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

      Dud e i am also facing the same problem.

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

      :/ Maybe problem with new version of Unity????????????????????????????

    • @__--_--_-----
      @__--_--_----- 5 лет назад

      im not sure why, but findobjectbytype and getcomponent arent interchangeable. go to that line in the error code and switch it to the other one and see if it helps

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

      Make sure your 'GameManager' is still in the hierarchy. I noticed mine was gone after i had placed it. I made a new empty object and put the GameManager script in it as a component and it worked!

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

      thanks ,this solution work me :)

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

    Hi so how would i do the following. When my timer hits 0 then I want the game to go the score menu and have his score display there ?
    If possible code would be helpfull, im still new at this.

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

    Hello, could you help me? I am using Microsoft Visual Studio 2019. While I am typing code, I don't have helping dropdown menu like you have (eg: "SceneManager." - 8:04). Is there any settings in Visual Studio that I need to adjust?

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

      I had the same problem. You need to go to Unity then Edit>Preferences>External Tools> , then choose Visual Studio 2019 as your External Script Editor

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

      @@shaanplayzgames4836 thanks a lot

  • @JoyceW-Art
    @JoyceW-Art 2 года назад +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 2 года назад +1

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

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

      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 2 года назад

      @@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.

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

    SOMEONE PLEASE HELP:
    For me it shows the Game Over statement in the console when the game starts, when it touches the ground. Someone please explain to me why it's doing this, even though a few videos ago I followed along when Brackeys talked about the player stopping when it hits something other than the ground, and it worked for me.
    I NEED TO KNOW!!

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

      I had the same Issue the rechecking the code I noticed that i added a ";" after if (rb.position.y < -1f)

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

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

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

      @@magicle855 i had the same problem and I did what you said to do put I did not change, do you know any other way to fix this?

  • @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.

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

    in 2020 i got problem that when i go to lighting panel i don't find any thing under the Fog click nothing just DEBUG settings . so any help ?
    tip* that i use a old version it 2017 . ^_^

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

    Hey, when I try use GameManager and PlayerMovement it said it could not be found. Does anyone know a fix?

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

      Viktor Make sure gamemanager is not in a folder, it took me forever to figure this out

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

      @@ceeplaysgames86 Assets\Script\playercollison.cs(7,12): error CS0246: The type or namespace name 'GameManager' could not be found (are you missing a using directive or an assembly reference?) can you help me ?

  • @LordOfLemon
    @LordOfLemon 6 лет назад +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.

    • @candorzofain8682
      @candorzofain8682 5 лет назад +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 5 лет назад

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

    • @candorzofain8682
      @candorzofain8682 5 лет назад +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

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

    I have a question.
    I did everything right and it's all working with the reset as it should.
    But when i build the game and start the game, when i hit something or fall from the platform the game doesnt reset, it just stop
    what should i do ?

  • @zbabarR
    @zbabarR Месяц назад +1

    My game is not running in Full Screen mode can you please help me 😢
    The Error is The Reference script (Unknown) on this behavior is missing

  • @Subst4nce12
    @Subst4nce12 2 года назад +5

    9:20 the set to auto part is not in the version 2020.3.16f1 instead go for the Environment tab in the lighting menu and then look for compression and put it in Uncompressed hope this helps

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

      TY

    • @exe.634
      @exe.634 2 года назад

      Tysm

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

      I put it in the uncompressed but it doesn’t work.. can I somehow fix it in another way??

  • @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 6 лет назад

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

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

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

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

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

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

      +Brackeys Read the main message please

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

      @@sentientringoffire7658 actualy you do

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

    help, please
    Assets\Scripts\PlayerCollision.cs(13,49): error CS0122: 'GameManager.EndGame()' is inaccessible due to its protection level

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

    Hi just asking for opinion, is it OK to detect when the player is out of bound in the GameManager script, like putting it in the Update method then detect the position of the player because I think it would be a lot nicer and easy to manage. Feel free to tell me wrong tho :"

  • @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.

  • @fox_sox
    @fox_sox 3 года назад +35

    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!

    • @Brayden_OTS
      @Brayden_OTS Год назад +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

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

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

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

    hey im having this problem when the player hits something or falls of the ground an error comes saying NullReferenceException: Object reference not set to an instance of an object
    PlayerCollision.OnCollisionEnter (UnityEngine.Collision collisionInfo) (at Assets/Scripts/PlayerCollision.cs:13) what does this mean?

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

      Yo just click clear on the console it doesn't do anything that's why your able to clear

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

      I do I all the time

  • @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 2 года назад

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

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

      Same
      thx so much for this

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

      you're the best

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

    using UnityEngine.SceneManagement does not exist in my visual studio plz tell what to do

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

    Assets\PlayerCollision.cs(26,45): error CS1061: 'GameManager' does not contain a definition for 'EndGame' and no accessible extension method 'EndGame' accepting a first argument of type 'GameManager' could be found (are you missing a using directive or an assembly reference?)

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

      also getting this error, did you get it resolved?

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

      @@abenedict85 watch the video carefully. I didn't remember how i fixed it . All i remember is that solution came from the video

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

    How to fix this?
    Assets/Scripts/PlayerCollision.cs(12.45): error CS0122: 'GameManager.EndGame()' in inaccessible due to its protection level.
    Also under every script there reads "The associated script cannot be loaded. Please fix any compile errors and assign valid script"