How to Collect Coins in Unity 3D Tutorial 2023 (Updated)

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 38

  • @bigchiefcxlvi7292
    @bigchiefcxlvi7292 Рік тому +9

    No way you have so little views. I'm working on a small game project and this helped out SO much. Your pace is perfect and you explain everything really thoroughly so we can keep up.
    Real lifesaver. Thank you, Tortoise Lady.

  • @darklordxark
    @darklordxark 9 місяців тому +1

    Thank you, this video fixed an annoying issue I was having where the first coin I would pick up would stay at "0" and then the 2nd coin I picked up would say "1". Now the first coin I pick up becomes "1". Thumbs up :)

  • @Adrian-gh4ps
    @Adrian-gh4ps 7 місяців тому +1

    I'm Just starting my journey with gamedev, and have to Say that from all the tutorials i have seen so far this one is the most simple and Well explained. Keep that up beacuse you're doing A great job ❤

  • @snick9314
    @snick9314 11 місяців тому +1

    instant sub, clear shows potential issues and gets the job done thanks a ton

  • @jamesmatson463
    @jamesmatson463 10 місяців тому +1

    Im just starting game dev, and this is the exact issue i was having!

  • @alexplaytop
    @alexplaytop 8 місяців тому +1

    Keep going - pretty well rounded info! Gotcha cheers!

  • @Maeniac
    @Maeniac 2 місяці тому

    This was incredibly helpful! Thank you!

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

    This was the best video. I’m definitely keeping this in my saves.

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

    Loved this video its simple and easy to understand and to follow !!!

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

    thank you soo much this is the only tutorial that worked for me

  • @mrzaphkielYT
    @mrzaphkielYT 11 місяців тому

    Things to use to avoid garbage collection in Unity for more optimization:
    - instead of other.transform.tag == "yourtag" use CompareTag("yourtag") if you comparing numbers use .Equals();
    - don't use debug.logs (it's fine for debugging but after finish clean them up)
    - when updating UI text element it's better to use two standalone text and only update the number and use .ToString() on it.
    Bonus fact:
    In the video if you use textelement.text = "something " + int you don't need to use ToString on the int since you already adding it to a string and Unity automaticly convert it to a string (but still it's a good practice to use ToString tho).

    • @ahmadpro3887
      @ahmadpro3887 11 місяців тому

      my canvas is just updating first if i collect more coins my ui is always 1

    • @mrzaphkielYT
      @mrzaphkielYT 11 місяців тому

      what is your code look like?@@ahmadpro3887

    • @RigorMortisTortoise
      @RigorMortisTortoise  10 місяців тому +1

      This is awesome info, thank you!

    • @mrzaphkielYT
      @mrzaphkielYT 10 місяців тому

      Cheers! Everyday we learn something new! Also, i want to update something on my 3rd statement where i say "it's better to use two standalone text" actually we can use one text and instead of yourtextname.text we can use the following formula:
      yourtextname.SetText($"Your string here, {your variable here} and you can keep writing and no need to use + or ToString");
      With the above .SetText method you can easly place your string and variables together and its easier to read imo, just don't forget to place your variables inside a {} brackets. :)

  • @T0mat0_S0up
    @T0mat0_S0up День тому

    How did you add that pirate coin to your hierarchy, and how did you animate too? Couldn't find any videos related to that.

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

    Thank you! (from Brazil) Wonderfull video.

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

    thanks! good tutorial

  • @Titan-dr5gc
    @Titan-dr5gc Рік тому +1

    Hi great video. How can we access the project file? website is not working

  • @summy1300
    @summy1300 Рік тому +3

    My coin collection script isn’t working. I have no idea what I am doing wrong :( the script is correct and I triple checked that I’ve added exactly the same components as you

    • @XxANATAGASUKIxX
      @XxANATAGASUKIxX 11 місяців тому +2

      I might be too late but I had the same issue. My mistake was adding the script to the coin instead of my player. So all I did is drag the script to the player and walla! it worked! I hope this helps.

    • @adampotatos6854
      @adampotatos6854 5 місяців тому +1

      @@XxANATAGASUKIxX OMG THANKSSS i was pulling my hair out thinking where i went wrong and i did what you said and it worked!! Thank you!!

  • @Boi4444yessir
    @Boi4444yessir 2 дні тому

    I am having trouble with this, it collided with the coin but it dosent collect it, idk what i did

  • @guillemrv6
    @guillemrv6 10 місяців тому +1

    How could you add that when you pick the coin it plays a sound?

    • @BastiaanNetjes
      @BastiaanNetjes 9 місяців тому

      I would also like to know this :)

  • @gagaelite7115
    @gagaelite7115 9 місяців тому

    Hi ya. I have a question. I set this up on a small 2d platformer game. However if I run into coins quickly, my counter can pick up more that 1 coin. If I have 3 close together sometimes it registers as 5 or 6. How can I lock this so it only picks up 1 coin?

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

    Thank you!!!

  • @4riftwalker
    @4riftwalker 8 місяців тому

    very helpful tutorial ✅✅✅✅

  • @thenicocarmo
    @thenicocarmo 11 місяців тому

    amazing tutorial worked perfectly fine, but i also want them to respawn after 5 seconds, how can i do that?

    • @mrzaphkielYT
      @mrzaphkielYT 11 місяців тому +1

      Instead of destroying the gameobject just disable it. Make a timer that runs if said gameobject is disabled aka collected. If the timer reach 5 seconds reenable the gameobject.

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

    I can't get it to work. I'm stuck at the collision part. In the coin if I uncheck IsTrigger I collide with the coin. But if I set it to be true it doesn't do anything. Maybe it's the logic on my player movement. I've tried over videos and they don't work.

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

      Interesting--checking "isTrigger" really just allows you to walk through the object so it's a little easier to interact with. If it's only working when it's unchecked, I would first double check that your player has a collider but that "isTrigger" is unchecked on your player, hope this helps!

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

      @@RigorMortisTortoise It has a Character Controller. Do I need a box collide too?

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

      I got it working. I didn't have Auto Simulate on under Physic project settings.

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

    SHIT IT WASN'T WORKING COZ I ATTACHED THE COIN COLLECTION SCRIPT TO THE COIN INSTEAD OF THE PLAYER 🥲 tHANKS FOR THE VID THOUHG IT HELPED A LOT