Click a button to add a score in Unity

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 43

  • @adnaneelbadri6613
    @adnaneelbadri6613 2 роки тому +11

    You are not aware, but saved me and 10 of my classmates our exam. You are awesome, thank you.

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

      exam where you just have to make a button that has some functionality?

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

    Thank you so much for this tut! You showed the stuff super well and clear. It helped a lot! :)

  • @notfinch6671
    @notfinch6671 3 роки тому +2

    Thanks for this, been trying to figure this out for a few hours now. This was a real life saver.

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

    This was so helpful thank you so much this needs more attention

  • @NotJaKobLol
    @NotJaKobLol 5 місяців тому

    Thx so much bruh! Ur goated

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

    i love you finally ive had this not working for so long u just earned a sub from me : )

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

    Hi. I am using TextMeshPro how I do that?

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

    Thank you so much!

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

    can you help me, i did everything like you but it doesn't give me points on click

  • @chillzfred839
    @chillzfred839 3 роки тому +2

    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!

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

    do you know how to increase the score when you click like every click is 200

  • @shikuzenkorai
    @shikuzenkorai 3 роки тому +3

    First of all... Great Video. I have a question. What about subtracting the score with another Button? Any solutions?

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

      @@alientaker9 i tried but doesnt work for me

  • @HartmanChannel
    @HartmanChannel 2 роки тому +2

    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

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

    how to fix int does not contain definition for int

  • @PVZFusionEdits-s1b
    @PVZFusionEdits-s1b 2 місяці тому

    thanks!

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

    I love u for that tutorial

  • @Lamar-jw4id
    @Lamar-jw4id 4 роки тому

    Thanks you are amazing

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

    Thank you so much.

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

    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!

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

    Very Nice thanks you.

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

    thanks so much

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

    Great Video! :)

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

    you just safe a college student LOL thanks

  • @SomeOne-rw6gz
    @SomeOne-rw6gz 4 роки тому

    Thanks!

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

    really helped!!

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

    Thanks

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

    heooo! thanks for helping

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

    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 роки тому +2

      im working on it

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

      @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 :)

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

    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();
      }
      }
      }

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

    wow

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

    This Sucked He is Amazing Please Support Him