In this video you will learn how to add a score when you click a button, and add UI to show your current score.
Пікірлер: 41
@adnaneelbadri6613 Жыл бұрын
You are not aware, but saved me and 10 of my classmates our exam. You are awesome, thank you.
@blacklinelv8278 Жыл бұрын
exam where you just have to make a button that has some functionality?
@niv6130Ай бұрын
Thank you so much for this tut! You showed the stuff super well and clear. It helped a lot! :)
@notfinch66713 жыл бұрын
Thanks for this, been trying to figure this out for a few hours now. This was a real life saver.
@neluga78463 жыл бұрын
This was so helpful thank you so much this needs more attention
@fivethumbs4fums5643 жыл бұрын
i must say that this helped me i am lucky to find this video, i didnt use it for score but to cause i want to make my own version of the wizard tower, up arrow = levels ++ or some shit like that (just to symbolise what level the player teleports to as text.) this be the only video that could help me thnx
@eeee21693 жыл бұрын
i love you finally ive had this not working for so long u just earned a sub from me : )
@HartmanChannel Жыл бұрын
When using text mesh pro. Simply change using unitys UI system to using TMPro; and also change form public text scoreText; to public TextMeshProUGUI scoreText; and that should work
@user-uh1jj3gd2i8 ай бұрын
love
@remus1404 жыл бұрын
Great Video! :)
@TheOneAndOnlyMilk4 жыл бұрын
really helped!!
@grzesiufranek92963 жыл бұрын
I love u for that tutorial
@teddylykowski80343 жыл бұрын
Thank you so much.
@chillzfred8393 жыл бұрын
Hello this worked very well and I thank you but I have been wondering how to make it add different numbers like instead of adding 1 each time it added like 3 thanks!
@Lamar-jw4id3 жыл бұрын
Thanks you are amazing
@trafinugrohomm7055 Жыл бұрын
Thank you so much!
@SomeOne-rw6gz4 жыл бұрын
Thanks!
@otmanbumbum54754 жыл бұрын
Very Nice thanks you.
@shikuzenkorai2 жыл бұрын
First of all... Great Video. I have a question. What about subtracting the score with another Button? Any solutions?
@carlosivorradomenech56902 жыл бұрын
@@alientaker9 i tried but doesnt work for me
@manunitedforever88652 жыл бұрын
thanks so much
@uxe_yo96574 жыл бұрын
Hi. I am using TextMeshPro how I do that?
@devkell99602 жыл бұрын
Oh that is fine just remove the tmp
@devkell99602 жыл бұрын
on the name
@flapplal64464 жыл бұрын
thenk u lal
@tarantula00713 жыл бұрын
thank you so much you are such an amazing person you just made me discover a new unity function and omg am I gonna abuse this welp anyways thank you so much you are a great person I hope you go to heaven!
@jonskelipoika2 жыл бұрын
do you know how to increase the score when you click like every click is 200
@chrisrayn88614 жыл бұрын
Thanks
@pidjon3332 жыл бұрын
can you help me, i did everything like you but it doesn't give me points on click
@GiannaBellatin Жыл бұрын
you just safe a college student LOL thanks
@fnafnpc6212 жыл бұрын
how to fix int does not contain definition for int
@wimtofi55873 жыл бұрын
heooo! thanks for helping
@nhanvuong84813 жыл бұрын
wow
@kevinvetter25184 жыл бұрын
Yes hi. I was just wondering how to subtract a ponit if i press a second button If you could please do a video of this next it would be greatly appreciated.
@ltazelpmas4284 жыл бұрын
im working on it
@kevinvetter25183 жыл бұрын
@Josiah Jacobson i know too XD... I've learned a lot about programming over the past year, i know now how to do it... And it's for sure been a journey :)
@maddoxman44 жыл бұрын
This Sucked He is Amazing Please Support Him
@zak_bucks3 жыл бұрын
diddnt work :/
@circular7473 жыл бұрын
same :( (great tutorial tho)
@pilotrl27093 жыл бұрын
@@circular747 You can try this script I'm not sure if that work: using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using UnityEngine.UI; public class Click : MonoBehaviour { public TMP_Text scoreText; private string score; void Update() { // if (Input.GetMouseButtonDown(0)) { scoreText.text = score.ToString(); //} } public void Addpoint() { score += 1; } }
@pilotrl27093 жыл бұрын
@@circular747 I have a working script but i works only with mouse click using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using UnityEngine.UI; public class Click : MonoBehaviour { public TMP_Text scoreText; public float score; void Update() { if (Input.GetMouseButtonDown(0)) { score++; scoreText.text = score.ToString("0"); } } public void ResetPoints() { scoreText.text = score.ToString("0"); } } AND THE SELL using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; public class Sell : MonoBehaviour { public Click _Click; public TMP_Text _MoneyText; public float _TotalMoney; void Awake() { } private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Sell")) { _MoneyText.text = _TotalMoney.ToString("0"); _TotalMoney += _Click.score; _Click.score -= _Click.score; _Click.GetComponent().ResetPoints(); } } }