Click a button to add a score in Unity

  Рет қаралды 9,247

lta zelpmas

lta zelpmas

Күн бұрын

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
@adnaneelbadri6613 Жыл бұрын
You are not aware, but saved me and 10 of my classmates our exam. You are awesome, thank you.
@blacklinelv8278
@blacklinelv8278 Жыл бұрын
exam where you just have to make a button that has some functionality?
@niv6130
@niv6130 Ай бұрын
Thank you so much for this tut! You showed the stuff super well and clear. It helped a lot! :)
@notfinch6671
@notfinch6671 3 жыл бұрын
Thanks for this, been trying to figure this out for a few hours now. This was a real life saver.
@neluga7846
@neluga7846 3 жыл бұрын
This was so helpful thank you so much this needs more attention
@fivethumbs4fums564
@fivethumbs4fums564 3 жыл бұрын
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
@eeee2169
@eeee2169 3 жыл бұрын
i love you finally ive had this not working for so long u just earned a sub from me : )
@HartmanChannel
@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-uh1jj3gd2i
@user-uh1jj3gd2i 8 ай бұрын
love
@remus140
@remus140 4 жыл бұрын
Great Video! :)
@TheOneAndOnlyMilk
@TheOneAndOnlyMilk 4 жыл бұрын
really helped!!
@grzesiufranek9296
@grzesiufranek9296 3 жыл бұрын
I love u for that tutorial
@teddylykowski8034
@teddylykowski8034 3 жыл бұрын
Thank you so much.
@chillzfred839
@chillzfred839 3 жыл бұрын
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-jw4id
@Lamar-jw4id 3 жыл бұрын
Thanks you are amazing
@trafinugrohomm7055
@trafinugrohomm7055 Жыл бұрын
Thank you so much!
@SomeOne-rw6gz
@SomeOne-rw6gz 4 жыл бұрын
Thanks!
@otmanbumbum5475
@otmanbumbum5475 4 жыл бұрын
Very Nice thanks you.
@shikuzenkorai
@shikuzenkorai 2 жыл бұрын
First of all... Great Video. I have a question. What about subtracting the score with another Button? Any solutions?
@carlosivorradomenech5690
@carlosivorradomenech5690 2 жыл бұрын
@@alientaker9 i tried but doesnt work for me
@manunitedforever8865
@manunitedforever8865 2 жыл бұрын
thanks so much
@uxe_yo9657
@uxe_yo9657 4 жыл бұрын
Hi. I am using TextMeshPro how I do that?
@devkell9960
@devkell9960 2 жыл бұрын
Oh that is fine just remove the tmp
@devkell9960
@devkell9960 2 жыл бұрын
on the name
@flapplal6446
@flapplal6446 4 жыл бұрын
thenk u lal
@tarantula0071
@tarantula0071 3 жыл бұрын
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!
@jonskelipoika
@jonskelipoika 2 жыл бұрын
do you know how to increase the score when you click like every click is 200
@chrisrayn8861
@chrisrayn8861 4 жыл бұрын
Thanks
@pidjon333
@pidjon333 2 жыл бұрын
can you help me, i did everything like you but it doesn't give me points on click
@GiannaBellatin
@GiannaBellatin Жыл бұрын
you just safe a college student LOL thanks
@fnafnpc621
@fnafnpc621 2 жыл бұрын
how to fix int does not contain definition for int
@wimtofi5587
@wimtofi5587 3 жыл бұрын
heooo! thanks for helping
@nhanvuong8481
@nhanvuong8481 3 жыл бұрын
wow
@kevinvetter2518
@kevinvetter2518 4 жыл бұрын
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.
@ltazelpmas428
@ltazelpmas428 4 жыл бұрын
im working on it
@kevinvetter2518
@kevinvetter2518 3 жыл бұрын
@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 :)
@maddoxman4
@maddoxman4 4 жыл бұрын
This Sucked He is Amazing Please Support Him
@zak_bucks
@zak_bucks 3 жыл бұрын
diddnt work :/
@circular747
@circular747 3 жыл бұрын
same :( (great tutorial tho)
@pilotrl2709
@pilotrl2709 3 жыл бұрын
@@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; } }
@pilotrl2709
@pilotrl2709 3 жыл бұрын
@@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(); } } }
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 706 М.
How to Make a Cookie Clicker Game in Unity
17:56
yaozer
Рет қаралды 2,1 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 56 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 63 МЛН
C++ Developer Learns Python
9:26
PolyMars
Рет қаралды 2,7 МЛН
Making the Simplest Clicker Game in Unity
5:11
Unity Mechanics
Рет қаралды 7 М.
Unity Tutorial: Open Panel on Button Click
3:39
Jayanam
Рет қаралды 171 М.
Updating score with Triggers in Unity
11:44
Back To Code
Рет қаралды 466
So you want to make a Game Engine!? (WATCH THIS before you start)
14:39
Giant Sloth Games
Рет қаралды 283 М.
2D Bullet / Projectiles in Unity / 2023
6:33
Distorted Pixel Studios
Рет қаралды 56 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 698 М.
Unity Change Scene With Button - EASIEST Method
6:09
Unitips
Рет қаралды 26 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 56 МЛН