How to make a HIGH SCORE in Unity
HTML-код
- Опубликовано: 28 мар 2017
- Let's make a high score!
❤️ Donate: www.paypal.com/donate/?hosted...
····················································································
► 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...
♪ There For You by: David Cutter Music - www.davidcuttermusic.co.uk
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 :)
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
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
You can also add bools with player prefs :)
@@drowsy5384 If you can store strings, you can store serialized data like jsons or xml.
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.
The real question is: How did Brackey learn to code when there were no Brackeys videos?
Top 10 questions scientists couldn't find an answer to.
documentation and documentation
Maybe He already knows C## before he was born...
@@informalmods6044 LMAO
Brackets invented code
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 :)
same thing with the highscore, had to do "public TextMeshProUGUI highscore;" to get it to let me slot the TMP into the component
@@Dragonhawk232 Thank you very much sir!
Bless. Just had this same issue, wish I saw this first lol
yah
"I like living in the edge so ill just do delete all" - Brackeys 2017
not funny :/
@GigaramsYT yeah
Dio
Why do people give dislikes?!!
This is literally FREE education!!!!!
jealousy, i guess ?
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.
@@K0BRAKID but this is exactly it lol
Dislikes don't always mean someone didn't like the video. I think people often use the thumbs down to tell RUclips 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.
H -Having
A - Anger
T - Toward
E - Everyone
R - Reaching
S - Success
^ That's why
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.
I was just about to go to bed....but who needs sleep. Love your videos btw, you are helping me fullfil my dream
Thanks a lot man! Glad I can help :)
@james matthews HUG
@@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!👍
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!
Thank you sooo much! I looked at other places for this information, but you're the only one who gave it out so simply.
That ending tho
Thanks Again Brackey’s. You bring inspiration to all of us 🙌🏽
Thanks Brackeys, this always helps me out when I'm struggling to make a high score feature.
Brackeys always makes me understand things very simple. Thank you.
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 :)
Dude you have no idea how helpful and easy to learn this was! Thanks alot! Cheers!
Who does not smile while watching Brackey's Tutorials.....this guy is awesome.
Great explanation of PlayerPrefs and how to use them. Thank you.
Just what I needed! (read in Mario's voice)
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
Your videos have helped me alot. I am almost done with my second prototype now!
Awesome tutorial man.
Thank you!
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!
This is great for saving sensitivity in mobile apps. Thanks a lot
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!
man really enjoy your vids
This was by far the easiest video to follow for this. Thanks a ton!
Thank you very much! It was quite simple in the end.
Thanks a lot, this was really helpful even 6 years later!
such an amazing video. has everything i needed.thanks!!
My man! Another great tutorial.
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!
this man makes me feel so smart with his tutorials, thx and goodbye brackeys
You are a life saver! I knew WHAT I needed to do but you showed me HOW. Thank you, thank you, thank you!
Thanks Brackeys!!
Great tutorial! Thanks
Best instructor EVER!!!
Bro, you Are Amazing... keep your work...
Thanks legend, realy helped with my first game, hope you come backone day
Great Tutorial man!
thank you! very clear tutorial
Thank you so muck for all your great videos
I love you man!!! Best tutorials ever! Hugs for you!
HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG HUG
Thanks a lot........Finally I Understand this High Score
thank you Sooo much!
Thank you so much, this helped me alot! 👍👍
Thanks brackeys that was very helpfull!
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!
this is the best unity channel ever .
Thank you so much ❤
this is soo awesome, I was searching for a way to implement the high score feature in my game, this one helped me.
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?
@@dcry1003 yes
Superb dance in the end!
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.
Thankyou so much!
exactly what I was looking for
I like the short tutorials and all, but I really wish that Brackeys would make a game tutorial series's like he used to.
it's been more than two years...
brackeys is still coming in clutch lmao
thx for shared!
Thank You very much, you helped me a lot
Sweet! Great tutorial! ...and awesome DANCING! 👍🤓🧡
That ending :D lovely.
great video, nice dance too
Thank you!
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.
Thank you bro :)
Thank you very much. Save a lot of time...
you are the best...thanks
I love this man
thanks brackeys , would you please make a tutorial about leaderboard !
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.
You are my hero man
when do we get multiplayer ingame chat tutorial for games
whooo ! that dance at the end
made my day ;)
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! 😂😂😂
great video thx
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 :)
Will you please make a leaderboard tutorial?
yaaa
Richard Wagner Then you need to connect your game to for example Google Play services
not really, you could have a leader-board like that on arcade machines.
Sebastian Lague has a great Leaderboard tutorial for unity. Check it out.
Really the best thing you can do (at least when targeting Android) is to use Google Play Games Services. It's simple and awesome!
thanks sir!!!
great video!
Nice video 🔥👌
is DeleteAll() function deletes all of the keys in scene or all the game ? Thanks :)
Thank you so much, always good videos. I tried having a ScoreManager that gets refered to, but that was a royal pain to get to work.. This is much simpler..!
Anytime you find a Brackeys video, you know you feel safe with your last minute projects.
Hi I'm a french young beginner in programming. Does it a good idea to make saves with "PlayerPrefs" or it's just for little variables ? What are the differences between the different way to makes saves ?
By the way, such a beatifull video, you help me so much ! Lovely regards.
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".
then you should put this code inside the for function:
PlayerPrefs.SetInt ("HightScore", number);
highscore.text = "Hight score : " + number;
@@zinebhalwi7510 and .ToString()
good explanation
Fantastic!
Could you make a video on how to move a game object back to a certain position
Hey,
Great Video !
I have a question... how can i apply this to another Scene so that i get the Score of the previous scene?
First you need a "Game Manager" script... Second, you need to put everything you want to be carried over to the next scene under it. Create an empty game object and call it "Game Manager" Put your game manager script on that. Then place everything not to be destroyed there. Then you need to add this code:
void Awake()
{
DontDestroyOnLoad(transform.gameObject);
if (FindObjectsOfType(GetType()).Length > 1)
{
Destroy(gameObject);
}
}
However, this will make duplicates so we are going to delete the original and keep the copy by deleting with a length greater than 1. You can find tutorials on this but you are more than welcome to use my code :)
use a static variable
Did you solve this? lol I cant find anything about it ...
thank you
Tq it is helpful
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👍👍👍👍👍
Conventions*
These "Playerprefs" remind me of Android "SharedPrefs" and just as easy. Thanks! :)
Please make a video about saving stats using JSON
Thanks is Work
Hi Brackeys can you make video about character animation(walking aiming running) and weapon menu selection Pls.
Sorry for bad English
Look his RPG series. :D Here he shows almost all
Question,isn't it more convenient in our case(handling text objects,as strings) to use .GetString instead of .GetInt?
Thank you :)
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.
how can i implement this in multiple game level ?
I use the same score script for the levels because its a time trial score system but now that i have used this video to add a highscore to this i get (ofcourse) the same highscore in the levels. do i need to seperate all the score systems per level or is there an easy way to fix?
Thank You So Much For The Logic. :-)
Thanks
1:36 both Unity wiki and this little popup box says that the max number *is* INCLUSIVE...