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.
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 :)
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 ❤
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).
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. :)
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
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.
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?
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.
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.
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!
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.
So glad I could help, thank you!!
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 :)
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 ❤
instant sub, clear shows potential issues and gets the job done thanks a ton
Im just starting game dev, and this is the exact issue i was having!
Keep going - pretty well rounded info! Gotcha cheers!
This was incredibly helpful! Thank you!
This was the best video. I’m definitely keeping this in my saves.
Loved this video its simple and easy to understand and to follow !!!
thank you soo much this is the only tutorial that worked for me
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).
my canvas is just updating first if i collect more coins my ui is always 1
what is your code look like?@@ahmadpro3887
This is awesome info, thank you!
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. :)
How did you add that pirate coin to your hierarchy, and how did you animate too? Couldn't find any videos related to that.
Thank you! (from Brazil) Wonderfull video.
Thank you, glad you enjoyed it! :)
thanks! good tutorial
Hi great video. How can we access the project file? website is not working
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
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.
@@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!!
I am having trouble with this, it collided with the coin but it dosent collect it, idk what i did
How could you add that when you pick the coin it plays a sound?
I would also like to know this :)
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?
Thank you!!!
very helpful tutorial ✅✅✅✅
amazing tutorial worked perfectly fine, but i also want them to respawn after 5 seconds, how can i do that?
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.
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.
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!
@@RigorMortisTortoise It has a Character Controller. Do I need a box collide too?
I got it working. I didn't have Auto Simulate on under Physic project settings.
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