How to make a HIGH SCORE in Unity

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ •

  • @Brackeys
    @Brackeys  7 років тому +197

    Hey everyone! Glad that you guys like the video :)
    Some of you are asking about security. Now PlayerPrefs is in no way secure. It is easy to read and modify values if you know what to search for. Of course you can do your own encryption before storing data through PlayerPrefs but I just found this free Asset Store plugin that works in pretty much the same way as PlayerPrefs but with encryption: www.assetstore.unity3d.com/#!/content/32357
    Hope that was useful to you :)

    • @drowsy5384
      @drowsy5384 7 років тому +2

      Brackeys encryption would be much easier with BinaryFormatter or XmlSerializer (I really prefer the first one) and also it's impossible to store anything but strings ints and float with playerprefs

    • @commentcommenter4198
      @commentcommenter4198 7 років тому +1

      Brackeys Hey brackeys. I really love your new tutorials! They are much shorter and understandable than your older ones?
      Will there be a chance of you making a new tutorial for a 2d platformer?
      I'm not fond of the old tutorials because of their length and I don't like your teaching style before.
      I'm also really glad you speak less inconsistently with no more "uhhh" in the vids

    • @Blackthornprod
      @Blackthornprod 7 років тому +10

      You can also add bools with player prefs :)

    • @gempio2634
      @gempio2634 5 років тому

      @@drowsy5384 If you can store strings, you can store serialized data like jsons or xml.

    • @noghost6797
      @noghost6797 4 роки тому

      Dude. I don't know how i adding Numbers. I mean *plus* . It's not working, and was to ask you in the comment seqtion.

  • @peterpeperoni7102
    @peterpeperoni7102 4 роки тому +891

    The real question is: How did Brackey learn to code when there were no Brackeys videos?

    • @rahulsbhatt
      @rahulsbhatt 4 роки тому +127

      Top 10 questions scientists couldn't find an answer to.

    • @akashroy4747
      @akashroy4747 4 роки тому +23

      documentation and documentation

    • @VioletDolphin
      @VioletDolphin 4 роки тому +46

      Maybe He already knows C## before he was born...

    • @VioletDolphin
      @VioletDolphin 4 роки тому +1

      @@informalmods6044 LMAO

    • @TheAlphaTeamPlays
      @TheAlphaTeamPlays 4 роки тому +23

      Brackets invented code

  • @Dragonhawk232
    @Dragonhawk232 Рік тому +52

    This is years later but in case anyone else is going through this old playlist learning unity, my unity by default uses TextMeshPro instead of regular Unity text, so a slight change I had to do within the Dice script was adding
    "using TMPro;"
    and then instead of a regular Text class you do "public TextMeshProUGUI score;"
    might save someone else the time I had to spend googling :)

    • @Dragonhawk232
      @Dragonhawk232 Рік тому +2

      same thing with the highscore, had to do "public TextMeshProUGUI highscore;" to get it to let me slot the TMP into the component

    • @BDL_CHANNEL
      @BDL_CHANNEL Рік тому +1

      @@Dragonhawk232 Thank you very much sir!

    • @b1llspc
      @b1llspc Рік тому

      Bless. Just had this same issue, wish I saw this first lol

    • @nirajtoysworld905
      @nirajtoysworld905 7 місяців тому

      yah

  • @gaycat599
    @gaycat599 4 роки тому +190

    Why do people give dislikes?!!
    This is literally FREE education!!!!!

    • @dev.prateek5781
      @dev.prateek5781 4 роки тому +12

      jealousy, i guess ?

    • @K0BRAKID
      @K0BRAKID 4 роки тому +4

      I was expecting a tutorial on how to save it to disk for the next time I launch the game. But his dance at the end made me take back my dislike into a like. Honestly I love this dude I couldnt dislike his video.

    • @zzzinga
      @zzzinga 4 роки тому +6

      @@K0BRAKID but this is exactly it lol

    • @BrentMurrell
      @BrentMurrell 4 роки тому +6

      Dislikes don't always mean someone didn't like the video. I think people often use the thumbs down to tell UA-cam what they are interested in when new videos are suggested or autoplayed. Because of that, I think a certain number of thumbs downs are unavoidable.

    • @mossupergamer1912
      @mossupergamer1912 4 роки тому +3

      H -Having
      A - Anger
      T - Toward
      E - Everyone
      R - Reaching
      S - Success
      ^ That's why

  • @wehh1
    @wehh1 7 років тому +260

    "I like living in the edge so ill just do delete all" - Brackeys 2017

  • @Doctrine60
    @Doctrine60 5 років тому +18

    Who does not smile while watching Brackey's Tutorials.....this guy is awesome.

  • @Mikewar1230
    @Mikewar1230 4 роки тому +2

    I just subscribed because 4/5 times when I am looking for a tutorial or explanation on something, your video shows up first and it's almost always the most brief but concise tutorial out there. Thanks man.

  • @trill9341
    @trill9341 7 років тому +206

    I was just about to go to bed....but who needs sleep. Love your videos btw, you are helping me fullfil my dream

    • @Brackeys
      @Brackeys  7 років тому +25

      Thanks a lot man! Glad I can help :)

    • @moric4677
      @moric4677 6 років тому

      @james matthews HUG

    • @parthudawant7015
      @parthudawant7015 5 років тому +3

      @@Brackeys Can you please tell about the resources you used to learn game development or some of the best books that must be read to learn game development and to achieve such great expertise like you have achieved ? Please reply!! Keep up the good work!👍

  • @GameOver7853
    @GameOver7853 7 років тому +130

    That ending tho

  • @matheusmachado5038
    @matheusmachado5038 7 років тому +24

    Just what I needed! (read in Mario's voice)

  • @yoctometric
    @yoctometric 6 років тому +4

    your tutorials are the perfect mix of learning from mistakes, quick comedy that adds to learning instead of taking away, and concise teaching. You have this down to an art, and I can't thank you enough

  • @forexalised9053
    @forexalised9053 6 років тому +2

    I changed my UI view to world space (was messing around) and rotated the UI and made it look all 3D :)
    Made the button a PNG of a Dice and added animations to the button to make it grow slightly larger on highlight, be slightly smaller on click/click hold.
    All in all, your tutorials are amazing and through them, I've been introduced to being finally able to just mess around with Unity and code :)

  • @gamedev_navneet
    @gamedev_navneet 3 роки тому +1

    Brackeys always makes me understand things very simple. Thank you.

  • @peeei7423
    @peeei7423 3 роки тому +1

    this man makes me feel so smart with his tutorials, thx and goodbye brackeys

  • @funkymonkey15963
    @funkymonkey15963 4 роки тому

    It's taken me days to get thru this series and then onto this vid. troubleshooting and the like cause Im kinda slow. but man it was all worth it to see Brackey do that little jig at the end!

  • @benjaminmartinez4159
    @benjaminmartinez4159 5 років тому +1

    Thank you sooo much! I looked at other places for this information, but you're the only one who gave it out so simply.

  • @neckudart272
    @neckudart272 7 років тому +4

    this is the best unity channel ever .

  • @abdulrhman-noor_2010
    @abdulrhman-noor_2010 3 місяці тому +1

    THANK YOU SO MUCH MAN

  • @toonzelda3353
    @toonzelda3353 2 роки тому

    Your video helped me out with a Unity assignment where I had to get the best race time :). I used exactly your algorithm and it helped me out! I don't know if you will see this comment Brackey's but thank you. You won't believe how much your videos have impact me and many others studying gamedev.

  • @tristanarnold232
    @tristanarnold232 6 років тому +1

    Thank you for all your videos!
    I am new to game development and you are really helping me learn fast. I am able to quickly learn core concepts, then experiment and expand on my own.
    Very well put together!

  • @thefallenlime
    @thefallenlime 3 роки тому

    This was by far the easiest video to follow for this. Thanks a ton!

  • @pruthvi4703
    @pruthvi4703 4 роки тому

    Thanks Brackeys, this always helps me out when I'm struggling to make a high score feature.

  • @aleksandarvagner9826
    @aleksandarvagner9826 7 років тому +82

    Will you please make a leaderboard tutorial?

    • @seunn
      @seunn 7 років тому +2

      yaaa

    • @jole0
      @jole0 7 років тому +1

      Richard Wagner Then you need to connect your game to for example Google Play services

    • @LoadX321
      @LoadX321 7 років тому +6

      not really, you could have a leader-board like that on arcade machines.

    • @Illu07
      @Illu07 7 років тому +9

      Sebastian Lague has a great Leaderboard tutorial for unity. Check it out.

    • @ResoCoder
      @ResoCoder 7 років тому +1

      Really the best thing you can do (at least when targeting Android) is to use Google Play Games Services. It's simple and awesome!

  • @sinakamali3297
    @sinakamali3297 5 років тому +1

    Best instructor EVER!!!

  • @braindamagecontent
    @braindamagecontent Рік тому

    it's been more than two years...
    brackeys is still coming in clutch lmao

  • @eze-cs
    @eze-cs 6 років тому +4

    Good tutorial! If you are making a larger game though, you may want to use encrypted or binary variables,
    but this is great for quickly making highscores!

  • @V.Z.69
    @V.Z.69 4 роки тому

    Thank you! I should have started learning Unity a long time ago. Losing AS3 on Flash was a huge setback for development solitary developers like myself. Back on the horse to make some extra income!

  • @valdak5277
    @valdak5277 10 місяців тому

    Thanks a lot, this was really helpful even 6 years later!

  • @shazwanabdullah9276
    @shazwanabdullah9276 3 роки тому

    Thanks Again Brackey’s. You bring inspiration to all of us 🙌🏽

  • @dealvik
    @dealvik 7 років тому

    I like the short tutorials and all, but I really wish that Brackeys would make a game tutorial series's like he used to.

  • @Oxmond
    @Oxmond 4 роки тому +1

    Sweet! Great tutorial! ...and awesome DANCING! 👍🤓🧡

  • @jacedaniels1812
    @jacedaniels1812 6 років тому

    Dude you have no idea how helpful and easy to learn this was! Thanks alot! Cheers!

  • @hansaldrinantonio1331
    @hansaldrinantonio1331 6 років тому +1

    Thanks Brackeys!!

  • @vpeter56
    @vpeter56 3 роки тому

    Anytime you find a Brackeys video, you know you feel safe with your last minute projects.

  • @meehdrescher
    @meehdrescher 3 роки тому

    In my opinion, this is better than the save and load system video.

  • @Kusaji
    @Kusaji 6 років тому

    Great explanation of PlayerPrefs and how to use them. Thank you.

  • @Rob-fi2pe
    @Rob-fi2pe Рік тому

    You are a life saver! I knew WHAT I needed to do but you showed me HOW. Thank you, thank you, thank you!

  • @ВојаПараноја
    @ВојаПараноја 4 роки тому

    Thanks legend, realy helped with my first game, hope you come backone day

  • @khankhalik2188
    @khankhalik2188 6 років тому

    Superb dance in the end!

  • @mammut4264
    @mammut4264 7 років тому

    Your videos have helped me alot. I am almost done with my second prototype now!

  • @WatchingTokyo
    @WatchingTokyo 7 років тому +55

    To make a high score in Unity you just need to beat everyone else at it!

  • @DevRightms
    @DevRightms 7 років тому +20

    whooo ! that dance at the end
    made my day ;)

    • @ShirshKhandeliaSKJ
      @ShirshKhandeliaSKJ 4 роки тому

      I literally was paused just before it to read the comments, and went back to see the "dance at the end". It hit me right in the face! 😂😂😂

  • @george9973
    @george9973 7 років тому +1

    Great tutorial! Thanks

  • @EndexPlay
    @EndexPlay 5 років тому +1

    great video!

  • @Moshugaani
    @Moshugaani 4 роки тому

    Thank you very much! It was quite simple in the end.

  • @b1llspc
    @b1llspc Рік тому +3

    Hey folks - I'm gonna save you some time, ready? If you can't drag Score text into the GameObject for the script, here's why:
    "Text" is no longer in use by Unity. it's TextMeshPro / TMP now.
    You'll want to update this code accordingly:
    // add this in up top
    using TMPro;
    // and instead of using the public Text score, change it to :
    public TextMeshProUGUI score;

    • @Acidpop
      @Acidpop Рік тому +2

      i owe you my life

  • @Term1nus3st
    @Term1nus3st 5 років тому +1

    This is great for saving sensitivity in mobile apps. Thanks a lot

  • @CarlosHasAIdea
    @CarlosHasAIdea 4 роки тому

    man really enjoy your vids

  • @hjc1710
    @hjc1710 4 роки тому

    My man! Another great tutorial.

  • @hahahpizza
    @hahahpizza 7 років тому +1

    This is so neat and simple, thanks.
    One thing I wanna ask is, What if I want the prefix before the text like this:
    High Score: "the PlayerPrefs value".

    • @zinebhalwi7510
      @zinebhalwi7510 7 років тому +4

      then you should put this code inside the for function:
      PlayerPrefs.SetInt ("HightScore", number);
      highscore.text = "Hight score : " + number;

    • @rakharuan
      @rakharuan 4 роки тому

      @@zinebhalwi7510 and .ToString()

  • @mirianchavchavadze7494
    @mirianchavchavadze7494 4 роки тому +1

    That ending :D lovely.

  • @kgibbsy
    @kgibbsy 5 років тому

    This is exactly what I'm looking for. I need a very simple level unlock system an I can amend this script slightly for that exact purpose. Thanks Brackeys!

  • @BlurryStars
    @BlurryStars 7 місяців тому

    How would you make a best time? Basically a countdown timer in the game, and then the fastest 3 scores on the game over menu. Can't find it anywhere on youtube. Love Brackeys tho, he almost always has the info I need!

  • @foreducation408
    @foreducation408 2 роки тому

    this is soo awesome, I was searching for a way to implement the high score feature in my game, this one helped me.

    • @dcry1003
      @dcry1003 2 роки тому

      hey i have a question, when using playerprefs does the highscore also get saved *(it still gets displayed in the chosen UI text)* when you exit your game and enter again?

    • @foreducation408
      @foreducation408 Рік тому

      @@dcry1003 yes

  • @harshalsingh7567
    @harshalsingh7567 7 років тому +1

    great video, nice dance too

  • @divsyntax9720
    @divsyntax9720 3 роки тому +1

    These "Playerprefs" remind me of Android "SharedPrefs" and just as easy. Thanks! :)

  • @mu6tu4e
    @mu6tu4e 7 років тому

    Awesome tutorial man.
    Thank you!

  • @Capnarchie
    @Capnarchie 7 років тому +14

    when do we get multiplayer ingame chat tutorial for games

  • @cinemacat4108
    @cinemacat4108 3 роки тому +1

    In the future, when I will gain money from game development, I think brackeys should make a whole video about my support on patreon 😂

  • @ChickenSwek
    @ChickenSwek 7 років тому +30

    Haha 8:30 great video!

  • @koofe0
    @koofe0 4 роки тому +2

    Asbjorn : Rolls a dice with 7 sides
    LITERAL MATH : Am i a joke to you?

  • @santoshpss
    @santoshpss 6 років тому +2

    I really like your forced smile in every video :)
    Edit: I really do, it really makes the video more enjoyable, but don’t force yourself :)

  • @Steve18795
    @Steve18795 3 роки тому

    Legend has it that he later closed brackeys and started his professional dancer career 😂

  • @wannaberickistevens
    @wannaberickistevens 3 роки тому

    such an amazing video. has everything i needed.thanks!!

  • @SpeedirX
    @SpeedirX 6 років тому

    I love you man!!! Best tutorials ever! Hugs for you!

    • @calebvonweichardt7785
      @calebvonweichardt7785 4 роки тому

      HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG

  • @gabrielesimoni6684
    @gabrielesimoni6684 5 років тому

    thank you! very clear tutorial

  • @MoshiGamePlay
    @MoshiGamePlay 5 років тому +1

    Great tutorial! How would i go about creating a top 10 personal highscore instead of just 1. I also struggle to carry over my current game score to my game over screen. Thanful for any sort of guidance.

  • @jb9480
    @jb9480 Рік тому

    Thank you so muck for all your great videos

  • @Pottsy
    @Pottsy 7 років тому

    Great Tutorial man!

  • @impheris
    @impheris 5 років тому

    Bro, you Are Amazing... keep your work...

  • @bip901
    @bip901 7 років тому +1

    1:36 both Unity wiki and this little popup box says that the max number *is* INCLUSIVE...

  • @lassewierowski1947
    @lassewierowski1947 4 роки тому

    Thanks brackeys that was very helpfull!

  • @badbuilding395
    @badbuilding395 7 років тому +1

    Hey, when multiplayer game is up to the public, and a lot of people host a game, will the dev have to pay more?

  • @still_adrian
    @still_adrian 7 років тому +8

    The end I looked at 5 times because I thought that I was dreaming.

  • @BeerfootBandit
    @BeerfootBandit 6 років тому

    I think Unity should recruit brackeys for those unite speeches they have at those conentions or whatever they are called because he is a pro at this. I learned alot from the vids keep it up👍👍👍👍👍

  • @SmartBunnyTuts
    @SmartBunnyTuts 6 років тому

    Thanks a lot........Finally I Understand this High Score
    thank you Sooo much!

  • @GuilhermeAkuro
    @GuilhermeAkuro 7 років тому +1

    great video thx

  • @philunityunreal7228
    @philunityunreal7228 5 років тому

    I have a question about "PlayerPrefs" . I lean from this video that it is skillfull for the highscore by saving int, float, etc by using PlayerPref.SetInt, PlayerPref.SetFloat, etc. Is it a way to do the same for an array? (int[ ] tab) Thanks for your attention and greetings.

  • @blind_neighbourhoodNerd
    @blind_neighbourhoodNerd 5 років тому

    Thankyou so much!

  • @tadeuvi
    @tadeuvi 6 років тому

    I love this man

  • @mracipayam
    @mracipayam 4 роки тому

    You are my hero man

  • @loliqueen9076
    @loliqueen9076 7 років тому +2

    Liked for that ending.

  • @aryamansingh8826
    @aryamansingh8826 5 років тому

    exactly what I was looking for

  • @curt7167
    @curt7167 7 років тому +1

    thx for shared!

  • @ZeroSleap
    @ZeroSleap 6 років тому +1

    Question,isn't it more convenient in our case(handling text objects,as strings) to use .GetString instead of .GetInt?

  • @victorfranky2245
    @victorfranky2245 4 роки тому

    Thank you so much, this helped me alot! 👍👍

  • @tesil123
    @tesil123 7 років тому

    As always video! Could you make one about damage text popup? Have the damage popup when you hit the enemy in the tower defense game.

  • @gamingstudio83
    @gamingstudio83 5 років тому

    Thinks Brackeys I worked for me and i learned something.

  • @TacticsTv
    @TacticsTv 7 років тому +1

    Nice video 🔥👌

  • @echilateral4497
    @echilateral4497 5 років тому +3

    NullReferenceException: Object reference not set to an instance of an object
    textscript.Start () (at Assets/scripts/textscript.cs:13)
    :(

    • @anotherrandominternetperso4994
      @anotherrandominternetperso4994 4 роки тому +1

      I know, you have already fixed that, but the answer is just for anyone else, who has this problem and is scrolling through the comments: An NullReferenceException means, that your you havn´t referenced your Gameobject in the Inspector. In this case, you just have to drag the Text Object into the slot in your skript. This is shown in 1:15 of this video. Have a nice day!

  • @omarjribi5687
    @omarjribi5687 6 років тому

    thanks brackeys , would you please make a tutorial about leaderboard !

  • @vaibhav4215
    @vaibhav4215 Рік тому

    Thank you so much ❤

  • @surgicalmaterials
    @surgicalmaterials 3 роки тому

    Im supposed to study but programming terribly interests me for some reason. I’m a beginner and I am making my own version of the roll-a-ball unity tutorial. :)

  • @lucaazogamer5511
    @lucaazogamer5511 4 роки тому

    Thank you!

  • @dp6501
    @dp6501 7 років тому

    Thank You very much, you helped me a lot

  • @robinchmelik2522
    @robinchmelik2522 6 років тому +1

    Thank you very much. Save a lot of time...

  • @crxssed7
    @crxssed7 5 років тому +2

    unity GOOEY

  • @periklisvairaktaridis132
    @periklisvairaktaridis132 6 років тому

    Please make a video about saving stats using JSON

  • @adamsabdulmajid9543
    @adamsabdulmajid9543 6 років тому +1

    you are the best...thanks

  • @jasminabadiyani9635
    @jasminabadiyani9635 6 років тому

    good explanation