Тёмный

Points counter, HIGH SCORE and display UI in your game - Score points Unity tutorial 

Coco Code
Подписаться 52 тыс.
Просмотров 134 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 164   
@RuthlessMetalYT
@RuthlessMetalYT 5 месяцев назад
I'm unable to drag text and high score into the canvas. :S
@deathtrooper2013
@deathtrooper2013 9 дней назад
I’m not sure if you fixed this or not but the way I did it was go into the text and deleted the textmeshpro in the inspector. Then add a text with add component. That should fix the problem
@SimonRabada
@SimonRabada 2 дня назад
@@deathtrooper2013Bro thank you i was facing the same issue and got it fixed because of your reply
@sonicbelmont300
@sonicbelmont300 2 года назад
I know this is an older video, and I'm still new to coding so I don't know how scalable this is, but if you're looking to make the score values different depending on the action (ex: killing an enemy is worth 50 points, picking up a coin is worth 5, etc) just do this: public void AddPoint(int pointValue) { score = score + pointValue; scoreText.text = score.ToString(); } and then when you call the function in another script, use a public int that you can call whatever you like, and set it to the points you're looking to reward it with and type out the function to replace the "pointValue" int with your new int, like so: public int points = 10; **Put this wherever you need to call it** ScoreManager.instance.AddPoint(points);
@mohammedfarook1048
@mohammedfarook1048 Год назад
omg thsm
@zaidalfayyadh_2537
@zaidalfayyadh_2537 Год назад
your'e genius, thanks for the help.
@Solenea112
@Solenea112 11 месяцев назад
This is what I was trying to do for the last 3 hours.. thanks man!
@IsZos
@IsZos 8 месяцев назад
Our hackathon team loves you. (No homo)
@MrMattyMoses
@MrMattyMoses Год назад
Thank you! This is exactly what I needed. You even made it simple enough to understand that I was able to make a few adjustments to make it fit what I was going for all while gaining an understanding of what I was doing to make it work.
@oliwierdrazek
@oliwierdrazek 2 года назад
Why did you not show us the code for removing the tokens can you please provide it please
@arnoldcheruiyot2657
@arnoldcheruiyot2657 Год назад
great work but I didn't see you code the TokenInstance part
@FePlayerStarVlogs
@FePlayerStarVlogs 2 года назад
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Points : MonoBehaviour { public Text scoreText; public Text highscoreText; int score = 0; int highscore = 0; void Start () { scoreText.text = " POINTS: " + score.ToString(); highscoreText.text = "HIGHSCORE: " + highscore.ToString(); } // Update is called once per frame void Update () { } }
@ZomBee04
@ZomBee04 2 года назад
You are the best kind of person frfr
@FePlayerStarVlogs
@FePlayerStarVlogs 2 года назад
@@ZomBee04 love you too mane
@jaroslavertl3785
@jaroslavertl3785 3 года назад
Nice viedo man! I would like to ask how to keep the score to the next level for an example. Player has 150 score passes one level and have 150 still and once he dies it will reset to 0. Thank you
@c4m3r0ntv
@c4m3r0ntv 3 года назад
Thanks! I was trying to solve this for a few days and your tutorial was just the thing I needed.
@CocoCode
@CocoCode 3 года назад
Glad it helped!
@claraf4062
@claraf4062 3 года назад
Thank you for this handsome tutorial you saved me :sob: :heart:
@jessnam
@jessnam 2 года назад
hello! can someone please answer quick question asap? I cannot seem to drag the score and highscore texts into canvas script manager variables? I am using text mesh pro and the canvas is set to world overlay. Not sure if that makes a difference though as I cant do it it any other overlay as well Thank you!
@jessnam
@jessnam 2 года назад
the issue was textmeshpro had to call text variables a diff way
@ZomBee04
@ZomBee04 2 года назад
@@jessnam I liked how you replied the solution, not many people do that so ty, idk the issue im a newbie at this stuff and im not upto that but if i were to get that issue or others we know how to solve it thanks to you Have a great day stranger :)
@jessnam
@jessnam 2 года назад
@@ZomBee04 salute to you stranger :) i am a newbie too! we will get through this together 🫡
@ZomBee04
@ZomBee04 2 года назад
@@jessnam hell yeah we will ✊
@danielgam1ng15
@danielgam1ng15 2 года назад
When I try to drag my text into the highscore and score, it doesn't let me. idk what i did wrong. Can someone pls help me with this?
@sebastianpinzon3585
@sebastianpinzon3585 Год назад
its because the new unity uses text mesh pro, look for the 1st comment it says how to use it
@RuthlessMetalYT
@RuthlessMetalYT 5 месяцев назад
goddman, tried to do this all day but nothing works. :S
@Polishpython
@Polishpython 27 дней назад
I solved the problem if you still have it after 4 months is you need to remove the textmeshpro component and search for the text and add it as an component then you can drag it
@RuthlessMetalYT
@RuthlessMetalYT 27 дней назад
@@Polishpython I think I solved this somehow. :D
@Polishpython
@Polishpython 27 дней назад
@@RuthlessMetalYT nice
@furkansivis7014
@furkansivis7014 3 года назад
Pls Help me i have this Error: Assets\ScoreManager.cs(17,20): error CS1001: Identifier expected
@MDanishIrshad
@MDanishIrshad 3 года назад
SEMICOLON ; ISSUE
@dokxyt
@dokxyt 2 года назад
how do i save the score and highscore ( if it doesn't already save) when going to a different scene?
@filipe_lopes
@filipe_lopes 2 года назад
probably with DontDestroyOnLoad(Object target)
@UncleRay420
@UncleRay420 2 года назад
As a newbie, I have no idea how to set up that second script.
@theGammaSpace
@theGammaSpace 3 года назад
Great work .Thank you for the well organised tutorial.
@philluvschips3787
@philluvschips3787 2 года назад
I'm getting the NO EXIT sign at 4min 12 secs, when I try and drag my Text to the corresponding 'Score Text' and 'High Score text' ! anyone else?
@elgrekko9634
@elgrekko9634 Год назад
Great tuto bro, maybe could you do a tuto about a little slot machine 3x3 reels vintage someday ?.. it will be awesome ! As u wish
@h3artang3l
@h3artang3l 2 года назад
Hi Coco code👋, how do you write a script sequence to destroy all the gameobjects, like 10+ gameobjects by assigning number order for each of one in runtime then press button to destroy it in sequence. THANKS 😊
@snop2754
@snop2754 2 года назад
How would i do this for an endless up runner (Endless vertical runner) ? Bassicaly the more you go up on the y axis the more points you gain?
@ShinichiKudoQatnip
@ShinichiKudoQatnip 3 года назад
Nice nice, well i have a question about playfab, is there a limit for playerdata and titledata? And if there is, does using json change that?
@CocoCode
@CocoCode 3 года назад
Yes: - max 10 keys updates at once - max 300kb of a data for one player - max 10 updates per 15 seconds You can check all limits in PlayFab -> Select your game -> title settings (gear icon) -> Limits
@ShinichiKudoQatnip
@ShinichiKudoQatnip 3 года назад
@@CocoCode Gee, thanks 😀
@GabyTheGameDev
@GabyTheGameDev 3 года назад
I have been stuck on this part forever thank you!
@mathias787
@mathias787 2 года назад
What should I do if i want to show the score on my endscreen because if the player dies the score resets instantly
@RuthlessMetalYT
@RuthlessMetalYT 5 месяцев назад
It won't let me drag the text and high score into the canvas, how do I solve this? pleas help.
@adeled8833
@adeled8833 2 года назад
the font doesnt work
@ahmednabeel1114
@ahmednabeel1114 2 года назад
it keeps saying "text" does not exist?
@loganandfun3917
@loganandfun3917 2 года назад
Probably because you're using text mesh Pro
@lrroseblack5003
@lrroseblack5003 2 года назад
hello i followed your method step by step but my highscore is not showing when i run the game
@kuroney
@kuroney 3 месяца назад
How to create the Points to collect? Im bit stuck..The counter doesnt get up if i destroy or collect a object.. is there a other Video to create the coins ?
@khawajausman5683
@khawajausman5683 3 года назад
how to reset the score on pressing the reset button....
@satanm8c40
@satanm8c40 2 года назад
Yea but like.. I don't have the "onplayerenter" script as I have not used the exiting unity game
@Amkih4070
@Amkih4070 2 года назад
You can make that methode and put onplayercollusiion or onplayertriger
@TacticalAssaultOfficial
@TacticalAssaultOfficial 2 года назад
Great job! This tutorial ended up working well for my needs. I do have an issue though. I have different scenes with different setups so the high score for each level would be different. How can I separate the high score per scene?
@TacticalAssaultOfficial
@TacticalAssaultOfficial 2 года назад
scratch that. I just made a dedicated Score Manager per scene and it works great!
@qualix7
@qualix7 2 года назад
@@TacticalAssaultOfficial can I ask what you meant by “dedicated score manager per scene”?
@Amkih4070
@Amkih4070 2 года назад
@@qualix7 maybe you can add some level manager that have a variabel about each level high score Example Int level 1 = 1627: After finish level 1 you can save that new score to the variable. On start scene. Load the variable and show into gui But dont forget about performance
@qualix7
@qualix7 2 года назад
@@Amkih4070 I see, that makes sense.
@mick3549
@mick3549 2 года назад
Hi thanks for that tutorial unfortunately I can’t drag things from the hirachy into my script slots (the step at 4:18 ) can anybody help me?
@thatoneguy1296
@thatoneguy1296 2 года назад
i found that it didnt work when i tried a text mesh pro text and i had to use a default unity text instead.
@filipe_lopes
@filipe_lopes 2 года назад
@@thatoneguy1296 when using text mesh pro the variable type Text is not compatible, you must use TextMeshProUGUI, as in "public TextMeshProUGUI scoreText;" for example
@thatoneguy1296
@thatoneguy1296 2 года назад
@@filipe_lopes that explains alot! did wonder why it didnt work thank you.
@MrMattyMoses
@MrMattyMoses Год назад
@@filipe_lopes this worked perfectly! I had this issue, and came to the comment section for a solution, and here you are! Thank you so much!
@gomes7066
@gomes7066 13 дней назад
​@@filipe_lopeswait, so what exactly do I need to replace on the code the video showed? And with what?
@ayaaa3112
@ayaaa3112 6 месяцев назад
How to add sound effect when the player collect the coin?
@christoskolliop693
@christoskolliop693 2 года назад
This is the best free software Ive seen. Respect.
@janispranevskis2307
@janispranevskis2307 2 года назад
Is that just me or anyone else got this issue : game count the points but doesn't save score after reloading scene
@wartekdz1601
@wartekdz1601 2 года назад
me too
@mrnsempai6986
@mrnsempai6986 7 месяцев назад
do this work for onentertrigger2d method///
@chrstopherwood7113
@chrstopherwood7113 2 года назад
You are an absolute HERO!!!! Thank you so much. Perfectly explained.Thank you so much! Cheers!
@MartinSparkes-BadDragon
@MartinSparkes-BadDragon 3 года назад
High Five Bro! Just what I was looking for.
@ZeroChronicles01
@ZeroChronicles01 2 года назад
hey , so quick question, how would i make it so i can controll the amount of score when give to the player? instead of just one, maybe like 3 or 5?
@youtubedeletedmyaccountlma2263
@youtubedeletedmyaccountlma2263 2 года назад
in the score +=1... you can just pass in value instead ....
@Amkih4070
@Amkih4070 2 года назад
You add [serializefield] value that you can change in Spector
@insipidisvalidation9101
@insipidisvalidation9101 Год назад
For Some Reason The Number Of Points Comes Before The Word POINTS. Is There A Way To Fix This?
@dragomirpetrov5600
@dragomirpetrov5600 3 года назад
Love the word play on the channel. Subbed (y)
@MattSigmaX
@MattSigmaX 8 месяцев назад
If I create a UI Text Mesh Pro I can't drag them over to the script, any suggestions?
@CocoCode
@CocoCode 8 месяцев назад
Then inside the script type TMP_Text insted of Text. You will also need to add "using TMPro;" at the top
@FeliXDev007
@FeliXDev007 3 месяца назад
@@CocoCode Thank you dude, it solved the issue, ur the best.
@raihankarimpriyo2004
@raihankarimpriyo2004 2 года назад
is there a setting Called Program*, its default is set to *Agressive TEwNice tutorialch is making that sNice tutorialtty static soft, change that one, once to
@mellowniight
@mellowniight Год назад
I know this is an old video, but still wanna try my luck, I have a different scene which I have to show my current score in the game over scene, how can I transfer the current score from the gameplay scene to my game over scene?
@DextraVisual
@DextraVisual Год назад
Errrr, where did that second script come from? Is it already part of the player controller? Where is it applied? Can I just make a tokenInstance script and add it to my current player controller? Comprehensive tutorial until that point.
@lilili765
@lilili765 11 месяцев назад
Exactly this
@Random-su8hr
@Random-su8hr 2 года назад
HeeEraAhEe = hierarchy
@uniKorn8
@uniKorn8 2 года назад
your videos are Gold for beginner like me. I can finally ship my first Mobile MiniGame Soon ( in 2-3 Months :D ) Thanks to you coco.
@ginp4750
@ginp4750 Год назад
Hi, I know it is a 2 year old video, but how do I edit the unity 2d microgame so that the level doesn't start again with some of the gems collected, but rather restarts the whole level? Kindest regards
@abramlewis7366
@abramlewis7366 Год назад
what do you put in the void fields on TokenInstance hidden script. And where do i put the tokeninstance script?
@itsevie4387
@itsevie4387 3 месяца назад
Quick and very easy tutorial, many thanks!
@kristiyanaleksiev8403
@kristiyanaleksiev8403 Год назад
man, ure so underrated, I know this is a simple thing, but somehow I struggled to do it. Thanks and upload more freqently if possible ;)
@nwotyzarc
@nwotyzarc 3 года назад
5:43 thank you so much 😍
@matthewperry6132
@matthewperry6132 Год назад
Hey this video helped alot, if you ever make a new one can you update it with the tip from @Ada in the comments?
@Koreyite
@Koreyite 2 года назад
When I compile the script, the variable doesn't show up on the script component.
@lordzetheron1904
@lordzetheron1904 Год назад
How do I do this with Visual Studio? I have a hard time translating it into Visual Studio
@JongSukSo
@JongSukSo Год назад
Thx for this Greatest Score Manager Tutorial. I adapt to my vr game and its work perfectly!
@wetmix
@wetmix Год назад
Thank YOU!
@omkar8379
@omkar8379 Год назад
can u tell how to set HighScore back to 0?????
@27thstudio4
@27thstudio4 2 года назад
thanks but i am unable to assign text object to the script by dragging it
@tntobi80
@tntobi80 2 года назад
How to give 500 likes Tutorial on that pls
@mrbubbly287
@mrbubbly287 2 года назад
can anyone help me, idk what and how to set up that second script, nor where to put it. 5:01
@stephenmcccabe
@stephenmcccabe Год назад
please i'm about to go crazy, this guy just randomly pulls out a new script at 4:40 and has everything minimized, what the heck am I supposed to do.
@DextraVisual
@DextraVisual Год назад
I know! Doesn't say where to apply the second script or anything!
@nugraha000
@nugraha000 Год назад
helping me su much, thank yu very much. keep it up. am subing
@anthonyramos5338
@anthonyramos5338 2 года назад
ive been making complete verses on a single soft, it seems everyone of these tutorials i find like to put a single instrunt on each
@satyamraj2476
@satyamraj2476 Год назад
I am using text mesh pro Due to which my code is not working. Please can anyone tell me what should i write?
@annemonx
@annemonx Год назад
instead of the "public Text scoreText;" line you should write "public TextMeshProGUI scoreText;"(the same with the highscoreText too). Also you should implement (aka put on the top where the using UnityEngine bulletpoints are) "using UnityEngine.UI;" and "using TMPro;" after all the others. Hope it works!
@simontheuer3606
@simontheuer3606 2 года назад
First Tutorial which worked for me.. thx
@filmmakerahmad1562
@filmmakerahmad1562 2 года назад
i want to i lose point can u told me how
@amirulkmpk9344
@amirulkmpk9344 2 года назад
my score doesnt reset :( what happened
@manjeetkdsfilmsakbarpur6930
@manjeetkdsfilmsakbarpur6930 2 года назад
Mylosp thanks man
@biged606
@biged606 Год назад
big thanks!!! keep going to make a tutorial:)
@przemysawrajn4970
@przemysawrajn4970 2 года назад
Wow, amazing. I'm looking for something like your tutorial. Thanks! :)
@ahsanshah7373
@ahsanshah7373 3 года назад
when the next stage starts it dose,nt shows previous high points or add point of current scene.
@c1nnabxnny153
@c1nnabxnny153 Год назад
this is by far the most helpful tutorial I've found, I actually finally managed to figure out how to make my score script work for my first-ever game project. Can't thank you enough!!!!!
@cardario5323
@cardario5323 2 года назад
0:20 what game is this? this looks so cool!
@umsnowie1813
@umsnowie1813 3 года назад
Hi, how did the score appear at the end game? For me, once my monster die, it doesnt appear, i need to stop playing so as to see the high score, please help me
@unwichtiger6694
@unwichtiger6694 Год назад
I started programming and made a comet shooter whitout counter, thanks coco!❤
@claudineidelima7181
@claudineidelima7181 11 месяцев назад
You saved my life!
@itzninjafool7479
@itzninjafool7479 2 года назад
Thank Coco Code! I have been trying to get a score script to work on a project that I am building. I had a very basic score script that I had coded but for some reason, it would not reset the score. This script worked the best of all the tutorials I had followed. I appreciate it!!! Keep up the great work!!!
@legendphoenix3066
@legendphoenix3066 2 года назад
Thanks man your a life saver! I've been trying to add score and high score for days and this is the perfect video (It helped me a lot tysm)
@dcry1003
@dcry1003 2 года назад
question, does this also work with a stop watc/timer type scoring system? *example having a high score of 1 minute and 13 second, and storing that in a new panel with a UI called best time (highscore) of 00.01.13 seocnds* or something like that *the stop watch/timer im refering to/using was the same from your other video where you teach on how add a timer on the scene*
@filipe_lopes
@filipe_lopes 2 года назад
yes, just use a float instead of an int and when passing the record value to the UI apply the necessary math to convert to readable time, 00:00.00 for example
@suleymanyasirmetin9567
@suleymanyasirmetin9567 3 года назад
I tried it but when score becomes 10 or 100 text move a little.
@mohsinaakterlucy9267
@mohsinaakterlucy9267 2 года назад
Quick question mike....
@RookieDev
@RookieDev 2 года назад
Thank you so much for the easy to understand tutorial, please keep up the good work.
@deletedchannel-greenfroglive
I love this
@Selflick
@Selflick 3 года назад
Tanks for helping me the second time :D
@marcosrodriguez1590
@marcosrodriguez1590 Год назад
Thank you so much!
@nguyendangcong
@nguyendangcong 3 года назад
can we use " singleton pattern '' technique in this case
@parisasoltani3986
@parisasoltani3986 9 месяцев назад
Awesome 👍
@Brai-niac
@Brai-niac Год назад
very helpful
@zambowastaken
@zambowastaken 2 года назад
hi good video but i have a question , how can I make the scene change after the score reaches a number that i chose
@lunaplays2960
@lunaplays2960 6 месяцев назад
im wondering the same thing. Found any solutions yet?
@davidbolivarg
@davidbolivarg 2 года назад
Dude, you saved my life
@mustafamajid7986
@mustafamajid7986 2 года назад
thank u was very clear and easy
@suldra915
@suldra915 2 года назад
Wooow thank you!
@vadimmereuta2283
@vadimmereuta2283 3 года назад
Thank you vey much!
@krishtyxd724
@krishtyxd724 3 года назад
Thank you! Helped a lot
@dazdev6682
@dazdev6682 3 года назад
thanks it helps a lott !!!
@mihaipauna4927
@mihaipauna4927 3 года назад
simple, clean and easy to follow.
@napoah
@napoah 3 года назад
N I C E
@kinza199x
@kinza199x 2 года назад
Great tutorial as always
@HoodedHavoc
@HoodedHavoc 2 года назад
Thank you. Tried a bunch of systems that didn't work, but this way did the trick. I thought about increasing the points through a method in one script, but not like this (gonna admit I didn't think about making the method public ;_;), and had never thought about doing .this on the awake. Thanks again.
Далее
The Easiest Way to Make a High Score in Unity
6:34
Просмотров 28 тыс.
КВН 2024 Встреча выпускников
2:00:41
Giving Personality to Procedural Animations using Math
15:30
I Oversimplified Famous Games
12:41
Просмотров 14 тыс.
Simple collectible coin system Unity Tutorial
11:21
Просмотров 25 тыс.
MAIN MENU in Unity - Unity UI tutorial
14:59
Просмотров 128 тыс.
I Made My First Game in Godot in 3 Weeks...
26:21
Просмотров 372 тыс.
How to make a HIGH SCORE in Unity
8:48
Просмотров 419 тыс.
How to make a menu in Unity - UI Tutorial
26:27
Просмотров 187 тыс.