SCORE & UI - How to make a Video Game in Unity (E07)

Поделиться
HTML-код
  • Опубликовано: 11 мар 2017
  • Let's create a score counter for our game!
    ● Download the Project Files: devassets.com/assets/how-to-ma...
    ❤️ Donate: www.paypal.com/donate/?hosted...
    ····················································································
    This video is part of a mini-series on making your first game in Unity.
    ····················································································
    ► Join Discord: / discord
    ♥ 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...

Комментарии • 2,6 тыс.

  • @wiktortofil9149
    @wiktortofil9149 5 лет назад +1148

    "Anything but Arial". Let's go with Comic Sans.

  • @fundamxd
    @fundamxd 5 лет назад +2357

    Tutorial : "How can a 9 minutes video take 2 hours of your time to finish watching it ?"

    • @HealthyWC-2
      @HealthyWC-2 5 лет назад +452

      "Only 9 minutes?" Psh, coding is easy... "Wait, let me copy that code real qucik and pause the video" "Oh shoot, I got some errors in my code, AGGH I DON'T KNOW HOW TO FIX IT, I SUCK AT PROGRAMMING and I don't understand any of the answers online.... OH I GET IT NOW" "Where is that button located in Unity? I DON'T KNOW WHERE IT IS... found it" "Hm... I have some errors again but its look correct, ohhh I misspelled Transform, it was transfomr, silly me" This should cover your reasons. ;)

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

      Lmao

    • @TimM-kz1vl
      @TimM-kz1vl 4 года назад +38

      @@HealthyWC-2 Protip: save a backup of your script if you like to occasionally experiment like I do.

    • @ivonedev9658
      @ivonedev9658 4 года назад +10

      it's 9.07

    • @higorss
      @higorss 4 года назад +23

      @@ivonedev9658 who the fuck care

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

    For who's having problem pulling component on 7:46, u should write public TextMeshProUGUI scoreText; instead of public text and than u will be able to pull component.

    • @icicle466
      @icicle466 11 месяцев назад +4

      i tried this but for me it says it couldn't be found what should i do?

    • @dementi5100
      @dementi5100 10 месяцев назад +4

      ​@@tristanfp4887 at the top of the code

    • @mdszirgun8715
      @mdszirgun8715 10 месяцев назад +1

      hello, still dosn't work... any other advice?

    • @AbhijitBalaji-rw1kj
      @AbhijitBalaji-rw1kj 10 месяцев назад +1

      @@tristanfp4887 Thank you so much!!!

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

      Thx

  • @niallpeel7832
    @niallpeel7832 9 месяцев назад +33

    4:02 Brackeys adds a font by simply dragging into the project tab. If you are using TMP (Text mesh pro) you first have to create the font asset by going to Window>TextMeshPro>FontAssetCreator and then drag the font to the Source Font File. From there when you go to select the font to use you can find it in the pop out window as Brackeys does

  • @krky
    @krky 7 лет назад +364

    Thank you for not only this video but also your all Unity Tutorial videos.

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

      You're welcome ;)

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

      Emre Karakaya oyunlar yapabildinmi?

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

      @@Xmsnjeje evet yapabildim, google play store'da yayınladım fakat güncellemediim için oyunlarım silindi malesef.

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

      I agree with this comment. I was just someone who didn't know anything abt making games other than scratch but I had a passion and now I'm working on my first game with only tutorials I found on this channel. Thank you so much.

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

      My player not moving, help!

  • @willpetillo1189
    @willpetillo1189 3 года назад +335

    For
    those using this as a reference or wanting to review specific parts of the lesson, here are some time-stamps of interest:
    0:11: Improving project organization
    0:34: Improving collision detection
    1:27: Creating on-screen text
    2:49: Scaling text with screen size
    3:38: Downloading a new font and applying it to text
    4:21: Getting player Z position
    6:00: Updating on-screen text
    7:45: Formatting text to display as whole numbers

  • @spacemonkeyspiff
    @spacemonkeyspiff 10 месяцев назад +70

    For those who are using TextMeshPro instead of the legacy text, make sure to include the namespace for textmeshpro, which is TMPro (so include the line of using TMPro; at the beginning of your code). Also instead of using public text, use public TextMeshProUGUI

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

      Thank You

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

      wdym

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

      @@JellyGang680 In this tutorial, Brackeys uses legacy text as this video is 6 years old and I believe TextMeshPro was not a proper feature in Unity. Now, we can use TextMeshPro which I believe is more customizable and easier to use. For your score script, you need to add a using tag for TMPro, or else you will face errors.

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

      Thank you so much

    • @kuinkyo7292
      @kuinkyo7292 9 месяцев назад +2

      I used this but I’m still getting an error does anyone know how to fix this?

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

    Brackeys: The only RUclipsr you don't have to crank up the playback speed for. These videos are really dense with material. I appreciate that.

  • @RadioactiveGamin
    @RadioactiveGamin 7 лет назад +228

    I disable my ad-block for this channel as you do these videos pretty much for free, and you've motivated me in the past. Now I know a decent amount of C# and I got a little bit of experience with Unity thanks to your previous tutorials. Just nowadays I can't find the motivation to continue when I need it most :/

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

      I'm glad to have helped :) For motivation I recommend forum.brackeys.com/ or this discord chat discordapp.com/channels/243005537342586880/243005537342586880 :) Good luck!

    • @AngelRodriguez-hs7bc
      @AngelRodriguez-hs7bc 4 года назад +28

      A lot of jobs are using Unity, and C#. If you need motivation - think of your potential career.

    • @DashMatin
      @DashMatin 4 года назад +9

      @@Brackeys thank you for making these tutorials . can you make a tutorial on making a game like ninja stick but in 3d please.

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

      @@Brackeys i dont know how to put z in the Debug.Log?

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

      My player not moving, help!

  • @smitaparida7847
    @smitaparida7847 3 года назад +202

    Nobody:
    Literally Nobody:
    ME: Playing my own game for 8 hours straight.

    • @cosmic2750
      @cosmic2750 3 года назад +18

      i sympathize, and i kind of feel its that way because we're proud of our first project :)

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

      same here buddy

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

      me too xDDD

    • @l_sx8722
      @l_sx8722 2 года назад +7

      and the best thing is we are the "god" of our game, whenever we feel something needs to change, we change that

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

      @@l_sx8722 yeh 😁

  • @TheMortemGaming
    @TheMortemGaming 5 лет назад +124

    Dude I know this is a very late comment but you're the best. After this tutorial specifically I used the methods from EVERYTHING you taught me and I made it so that the score stopped on a collision, its a small thing but i felt so proud that I did it myself from what i learned from you. THANK YOU!

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

      I'm happy 4 you! :)

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

      Noice

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

      can you plz give the code i have been trying for 2 hours and i still cant get it done

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

      @@reaperplays4170 On the collision script, add "public score theScore" as a variable and in the if statement, add "theScore.enable = false" and link up the text to "theScore".

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

      well done bro

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

    I always refer to your videos to learn new concepts. Started this series to revise and make a simple demo game for learning a new concept. I actually learned new options and features I was not aware of. Please keep posting such videos

  • @gummygengar3215
    @gummygengar3215 6 лет назад +6

    Your tutorials are absolutely outstanding! I have learnt so much more about designing and coding games thanks to you! Keep the tutorials up! They are very appreciated. Thanks

  • @rickole7404
    @rickole7404 4 года назад +504

    3:52 Red_Communist_Party.jpg
    what

  • @zendox
    @zendox Год назад +65

    if you're doing this in 2022, there's an easy solution, you can still get the old text without using text mesh pro
    go into the game object tab at the top, then UI, then you should see legacy at the bottom. if you go into it you should see text.
    then follow the rest of the tutorial like usual, if you get stuck you can use the code below, or use the debug mode that brackeys showed
    using UnityEngine;
    using UnityEngine.UI;
    public class Score : MonoBehaviour
    {
    public Transform player;
    public Text scoreText;
    void Update()
    {
    scoreText.text = player.position.z.ToString();
    }

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

    These videos have been the greatest! Thank you so much for making them! You present stuff in a way that's extremely friendly to beginners and you manage to not linger on a bunch of small stuff at the same time. You are awesome!

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

    This guy explains everything very comprehensively he is a cool good and awesome youtuber.KEEP UP!!

  • @sedotan2
    @sedotan2 7 лет назад +18

    OMG, i just got assignment from my college to make an UI in Unity and you upload this video. Thanks B!

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

      Also check out how he did the UI in the tower defense series, it looks really cool

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

    These videos are great, nice quick pace but you seem to get the most important details in there. Can't wait to try this stuff out!!!

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

    whenever my friends ask me how to do code, I immediately link them your channel. All of your tutorials are top tier.

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

    Dani sent me here and i love these tutorials, thanks bracky

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

    You are a fantastic teacher. Thanks for the interesting and informational tutorials!

  • @louis-philip
    @louis-philip 4 года назад

    You have no idea how helpful you are... These tuts are gold!

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

    I might be 4 years late but after 5 useless guides on this topic you just made things so much easier thank you so much

  • @mr.mysteriousyt6118
    @mr.mysteriousyt6118 7 лет назад +66

    keep up currently you are my best RUclipsr

  • @coolFM2001
    @coolFM2001 7 лет назад +264

    can you add a respawn mechanic in the next episode please

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

      Working on it ;)

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

      Brackeys yay respawn

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

      how to scale from center on MAC?

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

      He done it in a live for a 2D game i tried and it's work for this

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

      without respawn / boundary the game can get cheesed :O

  • @thisaccountisinactive1075
    @thisaccountisinactive1075 Год назад +1

    This man is a genuine hero to so many amateur coders

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

    This guy gives free education man....... soo cool, online crash courses take $200 and the quality here is better than them. Hats off to u bruh, keep it up.

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

    Brackeys is simply the best

  • @OmarMohamed-tn8es
    @OmarMohamed-tn8es 4 года назад +178

    For anyone didn't set player start z position to 0.
    Make an int equal to the player start position like( int x = - 55;)
    Then
    ScoreText. text = (Player. Position. z+x). Tostring("0")

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

      Thanks. What if I want to divide it. I'm starting on 40 and I want it to give me a point every 50 starting from z = 50

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

      Thanks

    • @OmarMohamed-tn8es
      @OmarMohamed-tn8es 3 года назад +1

      @Wowkoby That mean something wrong in your code text make sure you wrote it correctly and you didn't miss semicolon or send me your code so i can help

    • @user-rb1xv7iw2c
      @user-rb1xv7iw2c 3 года назад +2

      For those who have the position with decimal number use float

    • @OmarMohamed-tn8es
      @OmarMohamed-tn8es 3 года назад +2

      @Alessandro Bova 7:32 in the script

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

    Thank you. You inspired me to learn to program and make games but most importantly you taught me how to do it. I hope you are doing fantastic cuz you are a really good person

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

    Once I will end this course I will 100% leave a donation on your website, this channel is extremely helpful

  • @ath.bar.7671
    @ath.bar.7671 2 года назад +20

    For those who don't have their starting position at Z 0, I made something to make it easier:
    1. Add a public float variable called "initialZ"
    2. Add a void Start() method (if you removed it)
    3. Inside it, add "initialZ = player.position.z" (replace "player" with what you named your player)
    4. On the top of the Update() method, add the following: "float newZ = plr.position.z - initialZ;"
    5. Replace "player.position.z.ToString()" (where you change your text) with "newZ.ToString()"
    Your score will now start from 0 instead of minus something.

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

      thanks

    • @SwirlY-sTrAw
      @SwirlY-sTrAw 2 года назад

      thank you for this

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

      Thank you

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

      plz somone give me the full code for copy i have 2 error that saying:
      1. Assets\Scripts\Score.cs(14,18): error CS0236: A field initializer cannot reference the non-static field, method, or property 'Score.player
      2.Assets\Scripts\Score.cs(14,38): error CS0236: A field initializer cannot reference the non-static field, method, or property 'Score.initialZ'
      my code is:
      using UnityEngine;
      using UnityEngine.UI;
      public class Score : MonoBehaviour
      {
      public Transform player;
      public Text scoreText;
      public float initialZ;
      void Start()
      {
      initialZ = player.position.z;
      }
      float newZ = player.position.z - initialZ;
      void Update()
      {
      scoreText.text = newZ.ToString();

      }
      }

  • @oldladyjuljul
    @oldladyjuljul 4 года назад +18

    I'm really enjoying following along to this tutorial! Thanks so much for making these series.
    If you are like me and in the part where we add in scoreText.text = player.position.z.ToString(); code and playtested, you may have had an error in the code. Something along the lines of "variable player of Score is not assigned".
    That is because the script affects the player and the text, so the Text AND the Player get the script. Just uncheck the score script from the Player in inspector and it's good to go.
    Don't be like me and scub through the video and restarting unity many times. Instead, google the answer next time :') Hope this helps!

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

      thank you so much! this helped. the game worked but that error message was really annoying me, Thanks!

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

      that's.... two years ago now you probs figured it out

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

    Great series I learned more in this than a Udemy course. You just make it more understandable, even if they might have more details.
    For anyone who's number keeps the decimals, put in ToString("f0") . It was probably updated since this video, and the float means a decimal, so set the float to zero! ( As far as I understand it).

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

    I've made Jumpy Cube game with the help of Brackeys videos. Such a nice guy to share all his skills with us.

  • @mossaabtoualia8198
    @mossaabtoualia8198 2 года назад +58

    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 :)
    i found a this on the ep 8 i hope it work

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

      omfg thanks soooo much ur a lifesaver

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

      I wonder why I got that error, in the end i just figured out my script "score" was duplicated by accident. Thanks a lot man you saved me

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

      Bro i will legit give you 10$ for solving that thank you

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

      omg you saved me omg

    • @Sub-zero1123
      @Sub-zero1123 2 года назад +1

      Thanks a lot man

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

    Dude, you're amazing. Thank you for sharing this info.

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

    I also add the y and x position to score. Worked perfectly.

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

    I think this was the easiest one to follow, I’m glad UI is easier than I thought

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

    5:59 "So again we'll go into unity" *proceeds to open visual studio*

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

    My method of learning is to watch the whole video through, and make notes without pausing it. Then attempting everything from memory, then use my notes to help or end up re-watching parts of the video I got stuck on. That way I feel like I'm doing most the stuff myself.

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

    For a second there, I thought this video was going to be about making a musical score for your game. This makes much more sense.

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

    ive been trying to make a game for so long but didnt know how to do it , then i found this, thank you.

  • @nuggetlord4104
    @nuggetlord4104 2 года назад +12

    For anyone following this tutorial in 2021 or until they change it, you can add text from GameObject(at the top) -> UI -> Text

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

      ty bro you saved my code i was using the wrong type of text (text tmp)

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

      Or help I can’t find text only mesh pro I can’t put it in the score scprit

  • @Actually_saif
    @Actually_saif 4 года назад +81

    when ever i expand my game view i cant move my character using A and D but whenever its in default view everything works fine

    • @vishuu528
      @vishuu528 4 года назад +9

      @@buritto8784 god thank you so much!

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

      You can also use the combination Ctrl + P to start and that way you won't need to click on the screen

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

      @@detyvitanova749 thank u

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

      same issue!! How to figure it out?

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

      @@adityarana7956 click on the game window or click maximise on play

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

    I love tutorials like this, I come here to learn and it presents an amazing tutorial on the basics and i use the information to learn to make the game i want.
    I created a script that converts the distance to a percentage. My obstacles are differents weights and the game shows the heavier blocks to be darker which is calculated in a script, and i surprised myself by added a balanced jump mechanic.
    I urge everyone to experiment with these tutorials if you aren't already. It really shows that your learning to make a game without someone telling you exactly how to do it and it's an amazing feeling.

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

    The pure joy of seeing those numbers count up! =D

  • @normanp.chesterton7397
    @normanp.chesterton7397 5 лет назад +34

    Another note: Just taking the Z distance works fine in this instance, but if you want to be able to be less constrained in your level design, you would use the distance between the starting vector and the current position, of course.
    The author of this video knows all of this, of course - I am just adding some things that might be useful to the audience.

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

      Yeah he kinda mentioned that

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

      How?

    • @Rodri-gv8uf
      @Rodri-gv8uf 4 года назад

      @@tomthebigman7481 Guess we'll never know...

    • @Rodri-gv8uf
      @Rodri-gv8uf 4 года назад +8

      Could you please tell us how it's done? My player is at a negative z position, so the score remains negative. If I could do what you said, I'd be able to fix it.

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

      @@Rodri-gv8uf make the text = to the current position minus the starting position of the cube

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

    appreciate that you speed up your videos by cutting the parts without speed. but I think it went too fast ;)

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

    OMG dude you literally solved half of my problems
    THANKS ....

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

    This is the perfect tutorial I ever watched, thankbyou!💖

  • @ThatOneRobloxDev
    @ThatOneRobloxDev Год назад +6

    2:39 If you are using Text Mesh Pro, then disable "Wrapping" instead of enabling "Overflow"

  • @iamgod4u907
    @iamgod4u907 Год назад +88

    if you are having trouble with adding score in Text (TMP) copy this:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using TMPro;
    public class Score : MonoBehaviour
    {
    public Transform Player;
    public TextMeshProUGUI scoreText;

    void Update()
    {
    scoreText.text = Player.position.z.ToString("0");
    }
    }

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

      what the using TMPro; do

    • @iamgod4u907
      @iamgod4u907 Год назад +1

      @@rax0503 use to access text(TMP) object in our script cuz
      public Text scoreText;
      is for legacy text.

    • @rax0503
      @rax0503 Год назад +1

      @@iamgod4u907 I understand now thanks a lot

    • @4everbroke787
      @4everbroke787 Год назад +2

      You are a legend. Thanks!

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

      @@4everbroke787 😅😂thanx

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

    dude THANK YOU
    I was getting crazy trying to make a text prefab update a text on screen (surprise! it didn't work) so I watched your video and BAM. it works like a charm now. Thanks!

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

    absolutely love these turorials it teaches me the fundemantals and some code for future use even though i dont really know c#

  • @iKingOf
    @iKingOf 3 года назад +182

    Font Size: 69
    I really hope that was intentional.

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

    7:29 is the part we all come back to every month

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

    You have to increase the forward force when you increase the fixed update because of something he mentioned in one of the previous videos:
    We are doing force * time.deltatime which means that as you check your frames more often, the speed will become slower(remember that time.deltatime measures the time since the last frame). This means that as you check your frames more often, each frame will increase the force less.
    But note that this relationship is not linear

  • @Destiny4CODERS
    @Destiny4CODERS 7 месяцев назад +1

    I Had Been Copying Every Other RUclipsr's Video To Make My Video Game. But Because Of Your Course, I Can Make My Own Game Without Copying Anyone . thank you legend💖💖💖💖

  • @tuckerkrause5838
    @tuckerkrause5838 6 лет назад +62

    1:25 THANK YOU that has been annonying me sonce Ep 1

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

      Ret Zy oh GOD I THOUGHT I WAS THE ONLY ONE!!!

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

      Since*

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

    "But please, anything but Arial"
    Comic Sans has joined the chat

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

      excuse me sir, i can see you watched the video quite recently, so i have a question about a newer version of Unity. Whenever i right click on the left side (where all the objects are) the "ui" option doesn't show up. can you tell me where it is now ? thanks

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

      ​@@lucasgamesfr6s5 It's a bug from Unity, by accessing the "Game object" tab, you'll find the user interface option or "UI".

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

      @@veridius2274 ahh i can t find it and i am just starting understanding what to do but aa where can i find game object because i am not from anglish speaking countries and it is hard for me to understand hat to do
      perfectly.. thank you for answer

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

    Man your tutorials are SO DAMN HELPFUL! Cheers!

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

    Hey Brackeys, taking some time off work and decided to pick up some Unity knowledge. Thank you for making these, Beer on me. Ill refrence you in the credits of every game I ever make :)

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

    I am a big fan of yours.
    Can you teach to carry score from one level to next level,please

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

    1:08 I put mine on 8000... it FLEW like a Kamikaze! 0_o
    Loving this series so far, thank you so much 4 making it ^^

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

      reenact 9/11

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

      I had the same problem, then I realise I messed with the Time Manager without realising.

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

      @@starman4346 LMFAOOOOO

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

      @@xord1946 Well, glad you got it fixed tho! :D

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

    As always, you the man. Thanks for the great content, you really rock.

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

    Is it only me who gets insane satisfaction when you try to guess the next step and it acctually works?

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

    I love your videos!

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

    I followed this series for 4 consecutive episodes and now im getting game dev ads nonstop xD the "algorithm" works.

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

      same here : )

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

    I am watching this during lockdown.
    I am now going to make a game, I also watched all his vids together and I think I can make it to the end of my game. Unity has taught me that 2d games are harder to make.

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

      3D Games would make it the hardest to make for us. Have you finished making your game?

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

    my game is getting better and better. thanks!

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

    If anyone wants to disable the text, and then enable it on start up.
    Go into your Score script, make a Start() method and put score.enabled = true; This text controls the little checkbox besides the Text element, where you probably typed 250.
    Then, go to your text element, in the text object, and disable it, and on start up, it should appear.
    If you want to keep it enabled, and leave it there, obviously just change the text to 0.

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

      Mech I need help and since this is an old video I though my best shot was to reply to someone, and you seem like you know what you’re doing. When I was trying to get the text to work it suddenly got really low quality and won’t go to a size over 27. I’m not sure how to fix it, please help.

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

      @@skittlebread41 I completely forgot how to code, I'm sorry. I dropped off and I need to learn it again. I don't even understand what I'm saying in my own text.

  • @hpr895
    @hpr895 5 лет назад +23

    Hi! If you using the Text Mesh Pro, just add this on "using":
    using TMPro;
    then:
    public TextMeshProUGUI scoreText;

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

      god thank you so much man, was thinking why it wasn't working

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

      You're the best

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

      Helps a lot

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

      How can I use Text Mesh Pro? Should I download it or is it included in the Unity editor?

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

      i had this problem too

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

    This tutorial really helped in setting up UI for my first person shooter. Like from me!

  • @hey-ef6wv
    @hey-ef6wv 2 года назад +1

    this guy helped millions of people to start game dev in the lockdown and corona peroid

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

    Alright, I see a lot of people have a problem where this error happens "UnassignedReferenceException: The variable Player of Score has not been assigned." And I got this as well. The error is most likely that you forgot to do this part 5:35 and you might have forgotten to do the same with the script. If you still have problems don't be afraid to reply to this comment.

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

      tanks you helped me a lot

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

      I'm having this problem, but i have assigned the player to the variable, im very confused.

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

      I did everyrhing that you said and I still got the error

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

      i have a problem that so that the i dont have the "Player" variable in the "Score" script which prevents me from draging the player into there
      If anyone knows what i could have done wrong please reply with the solution
      i accidentaly closed unity but im going to open it so i can ctrl+c ctrl+v the error message
      edit:Assets\Scripts\Score.cs(5,14): error CS0101: The namespace '' already contains a definition for 'Score'

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

      You are the best kind of human.

  • @user-iw2zv9bp4o
    @user-iw2zv9bp4o 3 года назад +5

    7:42 I am a newbie and I solved this problem my way. Surprisingly, my code works correctly. I decided to leave my decision inside the game, because my own terrible is better than someone else's and beautiful. By the way, here's my code:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    public class Score : MonoBehaviour
    {
    public Transform player;
    public Text scoreText;
    int convertPositionZ = 0;
    void Update()
    {
    convertPositionZ = (int)player.position.z;
    scoreText.text = convertPositionZ.ToString();
    }
    }

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

      well I have a problem converting the int format and your code helped it!! thanks you mate ^^

  • @fadelazidan7731
    @fadelazidan7731 Месяц назад

    am i watching a tutorial from 7 years ago? Yes
    am i happy with it? Hell Yes
    Thank you

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

    Your tutorials are the most best

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

    -For anyone who wants the score to stop counting when you fail, just change the score script adding
    if (movement.enabled == true)
    {
    scoreText.text = player.position.z.ToString("0");
    }
    -and dont forget the
    "public PlayerMovement movement;"

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

    Great tutorial series!!!

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

    great tutorial; short and simple

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

    I downloaded the script because when I tried to type it out, I couldent get the player as a target for the score, and the downloaded script also doesnt work
    its says "A using clause must precede all other elements defined in the namespace except alias declarations"
    and idea whats wrong

  • @Faris._.
    @Faris._. 5 лет назад +38

    in case anyone faced a problem where the player is SO fast and skip through every obstacle , its because you put the time step at 0.1 instead of 0.01. just in case :)

    • @OK-ps2vz
      @OK-ps2vz 4 года назад

      I decided to play test, and suddenly, my player/cube was able to go past the obstacles. It physically made contact with the obstacle, but it would just speed past it, and my movement would keep going on. Have you experienced this?

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

      i am having that problem, where do i go to change that value?

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

      @@MichaelSalton go to edit at the top left and at the bottom it says project settings then there's a tab called time you go to and its called fixed timestep

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

      ​@@roboticreviewer9159 It wont let me edit the fixed Timestep

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

      I go to edit. Then hit project settings. then a tab pops up. then i go to time. then you cant edit anything.

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

    Thank you man for sharing this stuff

  • @johna.5293
    @johna.5293 4 года назад +1

    Tip: Turn of gravity and you can float off the edge of the platform and dodge all the obstacles ;)

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

    For those whose text is missing when font size is too big, just increase the text area

  • @normanp.chesterton7397
    @normanp.chesterton7397 5 лет назад +5

    Here we can see a good example of how to decide whether to use Update or UpdateFixed. UpdateFixed would have updated the score independently of the frame rate. But, because it probably doesn't make sense to update the scoreboard faster than we can draw a frame, it makes more sense to use Update. In this case, according to the Unity documentation, UpdateLate, I think, would be the most appropriate place, because we can or should probably draw our score after the frame is done drawing.

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

    Your video is amazing and keep up the good work!!!

  • @flashverse2.06
    @flashverse2.06 3 года назад

    May God bless this man,he has helped me alot

  • @JustAhmed_yt
    @JustAhmed_yt 11 месяцев назад +5

    People who dont find "Text" but who find "Text meshpro" The text UI thing is in "legacy"

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

      no prob3 people liking this + myself Xd

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

    Save Often! Getting far enough along in the series that I want to try other things. Unity crashed on me and I lost at least an hour of work. (Could have been worse!) Lesson learned, Lesson shared.

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

      There are two types of people that use computers:
      1. Those who already lost data due to not saving
      2. Those who yet have to

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

      Ctrl+S is something that should be made second nature while working on projects. Saves me a world of annoyance when something crashes.

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

    your awesome, I went from 0 knowledge of any coding to fully complete prototype in 4 days

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

    Thank you very much Brackeys ^.^

  • @maximilianosierralta589
    @maximilianosierralta589 3 года назад +8

    Guys, for everyone that has problems with the text not showing when you're in game mode / maximize, in the text remember we put the horizontal to overflow? put the vertical too!

  • @LnPPersonified
    @LnPPersonified 5 лет назад +9

    When he said create a score, I thought he was talking about music.

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

    this guy helped me a lot

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

    thank you u restored my faith in humanity

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

    I'm trying to make a high score but I don't know how you convert a string to a int or float?
    Please help thx

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

      int test = System.Convert.ToInt32("1000");
      Debug.Log("string of 1000 - 400 =" + (test-400));
      Displays "string of 1000 - 400 = 600" in console. You can also place some string variable in ToInt32(). Beware - if the string cannot be 'cleanly' converted to an Int32, it will throw an exception error. You can use a Try/Catch statement for best practice. There are similar Convert commands for other data types, which you can see once you type 'System.Convert.' into visual studio. You could also place the 'System' namespace in the 'using' statements of your script, then just use the Convert statement in the body.