How to Collect Items (Unity Tutorial)

Поделиться
HTML-код
  • Опубликовано: 19 дек 2024

Комментарии • 158

  •  2 месяца назад +1

    For anyone having trouble selecting InventoryUI in the last step, make sure you attached it to the text!!! Thank you, this tutorial was very helpful!

  • @glebkozlov1603
    @glebkozlov1603 2 года назад +9

    Man that was delightful. After all those rushy tutorials this series is a breath of fresh air. Thank you!

    • @KetraGames
      @KetraGames  2 года назад +1

      Thanks very much for this 😊

  • @attenurmi936
    @attenurmi936 2 года назад +13

    This series is clear, simple concept, well planned and fun to follow. Thank you! I'm really looking forward on seeing more of these videos!

    • @KetraGames
      @KetraGames  2 года назад

      Thanks for this great comment 😊

  • @jatsparrow
    @jatsparrow 2 года назад +3

    Thank you for this beginner friendly tutorial. I'm waiting for your next tutorial.

    • @KetraGames
      @KetraGames  2 года назад

      Great to hear, thank you 😊

  • @marcobarberio6910
    @marcobarberio6910 Год назад +5

    I'm having problems with the last part in which we should see the number of items collected. It doesn't change. In addition, inside Inspector -> yer Inventory (Script) -> InventoryUI, UpdateDiamondText doesn't appear, why? (I followed all the steps and copied the codes)

  • @thesilentwisp
    @thesilentwisp 2 года назад +1

    This was super helpful. Didn't know about the events system!

  • @tjorloski1961
    @tjorloski1961 2 года назад +3

    I'm also getting that bug where the Unity event is not showing the Update player inventory thing. it was working fine on 2020.3 , but on my new project in 2021.3 it isn't working

    • @KetraGames
      @KetraGames  2 года назад

      Hi, that's strange. I've upgraded the project to 2021.3 and it seems to work fine. As an alternative, you can make the event a plain event e.g. public UnityEvent OnDiamondCollected; Then you can select the PlayerInventory in the Inspector when wiring up the event. Hope that helps 😊

  • @qistinaalia4493
    @qistinaalia4493 Год назад +2

    Hi I cant seem to find the update diamond text method, can you help me?

    • @KetraGames
      @KetraGames  Год назад

      Hi, the full script can be found here - dotnetfiddle.net/Rzs92c
      Hope that helps 😊

  • @gabryelhuneault1801
    @gabryelhuneault1801 2 года назад +2

    I figured it out the text issue but I have another issue. The updated playerinventory script works fine but the subscriber list doesn't appear or show up. Please help! ASAP!

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, I think this will be a limitation with the version of Unity you're using not supporting generic events. As an alternative you can make the event a plain event e.g. public UnityEvent OnDiamondCollected; Then you can select the PlayerInventory in the Inspector when wiring up the event. Hope that helps 😊

  • @muscatalexj
    @muscatalexj Год назад +2

    How would you reference the number of collected items in another script? Im trying to make it so that once i pickup 10 an achievement pops

  • @samirehman4565
    @samirehman4565 Год назад

    finally someone who didn't use destroy function on collectable.

  • @michelec1178
    @michelec1178 2 года назад +1

    Thank you, please more tutorials 😊 ,very good tutorials!

    • @KetraGames
      @KetraGames  2 года назад

      Glad you're finding them useful 😊

  • @guruprasadh_j
    @guruprasadh_j Год назад

    Most clear video to understand;

    • @KetraGames
      @KetraGames  Год назад

      Great to hear this, thanks 😊

  • @jkair5352
    @jkair5352 2 года назад +1

    does anyone know how to get a "you win" page when the player have collected 10 items?

    • @paulpopSignatur
      @paulpopSignatur 11 месяцев назад

      If you figure it out let me know I'm looking for the same question

  • @Manofthebean
    @Manofthebean 2 года назад

    thank you this was a big help in my game!!

  • @aryanpatankar8168
    @aryanpatankar8168 Год назад

    Thanks!
    it worked for my mobile game!

  • @jameszchan6096
    @jameszchan6096 2 года назад +1

    How can I make the item only be pickd up whn a player is holding a certain key?

    • @KetraGames
      @KetraGames  2 года назад

      Hi, you could store a reference to the diamond in the OnTriggerEnter method. Then you could remove the reference in the OnTriggerExit method. Then in Update you could check for the button press and pick up the diamond if the reference is not null. Hope that helps 😊

    • @ev9787
      @ev9787 Год назад

      @@KetraGames hi, i would love to do this for my game, but it doesn't make sense to me, could you explain it in more detail, im a beginner

  • @Wraith4444
    @Wraith4444 Год назад

    TYSM IT HELPED MY GAME SOO MUCH

  •  4 месяца назад

    I love u so much thank you for helping this helped for my project

    • @KetraGames
      @KetraGames  3 месяца назад

      Great to hear, thank you 😊

  • @gabryelhuneault1801
    @gabryelhuneault1801 2 года назад +1

    I can't use TMPro in my unity project because I'm using unity 5.6.7f1 and textmeshpro isn't available. Please help

  • @protophase
    @protophase Год назад

    Well made tutorial, easy to follow. What if you wanted to play a sound whenever you collect a gem?

  • @davidkunle1512
    @davidkunle1512 2 года назад +1

    Hi great tutorial I'm just wondering how do I make it so when you collect a number of items it brings you to a new scene like a game over scene.

    • @KetraGames
      @KetraGames  2 года назад

      Hi, thanks. You could add another script that contains a method that checks the number of items collected and then executes your desired action. Then you could wire up the collected event to this new method. Hope that helps 😊

    • @spongehead93
      @spongehead93 2 года назад

      @@KetraGames Is there any chance we could get some code written out for this method to check the number of items? I'm trying to do something similar but I keep getting an error saying that the playerInventory is non-invocable. Here's the code I've written below:
      public class PhotoAppear : MonoBehaviour
      {
      PlayerInventory playerInventory = GetComponent();
      void Start()
      {
      gameObject.SetActive(false);
      }
      // Update is called once per frame
      public void Update()
      {
      if (playerInventory.NumberOfPhotos() == 5)
      {
      gameObject.SetActive(true);
      }
      return;
      }
      }
      As well, thank you for this tutorial, what it covered was very easy to follow and understand.

    • @muscatalexj
      @muscatalexj Год назад

      Did you ever figure this out?@@spongehead93

    • @muscatalexj
      @muscatalexj Год назад

      How would you write that in code?@@KetraGames

    • @paulpopSignatur
      @paulpopSignatur 11 месяцев назад

      Yes I'm looking for the same tutorial nobody has it😢😢

  • @potatojann233
    @potatojann233 2 года назад +1

    Goshh😭 thank you so much. I totally appreciate it.

  • @nimomaniachannel
    @nimomaniachannel 2 года назад

    this was so clear and its recent. im subbing

  • @NotSoSeriousGaming
    @NotSoSeriousGaming 2 года назад +1

    Thank you for such a great guide! How would you carry the gem display onto another scene? I tried the same thing but nothing displayed

    • @KetraGames
      @KetraGames  2 года назад

      Hi, good question. There are a few ways you can pass data between scenes
      1. You can use PlayerPrefs to save and load data between scenes - docs.unity3d.com/ScriptReference/PlayerPrefs.SetInt.html
      2. Game Objects can survive between scenes if you set DontDestroyOnLoad so this may be a possibility - docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html
      3. Another option is to store the data in a ScriptableObject which will then persist across scenes - docs.unity3d.com/Manual/class-ScriptableObject.html
      Hope that helps 😊

    • @NotSoSeriousGaming
      @NotSoSeriousGaming 2 года назад

      @@KetraGames wow you didn't hold back i really appreciate this.. you are amazing! Keep up the great work !

  • @ani-gamer320
    @ani-gamer320 2 года назад +1

    Thanks for this tutorial ❤️❤️

  • @damontebooze4869
    @damontebooze4869 Год назад +1

    bruh I got an error something about it not containing a defintion

  • @Darkwar9099
    @Darkwar9099 2 года назад

    Nice vid it works great on my own game

    • @KetraGames
      @KetraGames  2 года назад +1

      Thanks, good to hear this 😊

  • @corrohsivegaming7077
    @corrohsivegaming7077 2 года назад

    Lovely video! The only part I am wondering is how would I add a sound to when I collect a diamond?

    • @KetraGames
      @KetraGames  2 года назад

      Hi, to play a sound you need to have an audio source. Because the diamond is disabled when it's collected, it won't be able to play the sound itself. Therefore, you will need to add an audio source to the Player object. You can then play as sound using AudioSource.PlayOneShot - docs.unity3d.com/ScriptReference/AudioSource.PlayOneShot.html
      Hope that helps 😊

    • @alejandraalcocer9857
      @alejandraalcocer9857 2 года назад

      @@KetraGames but it doesnt work if its collider other, how do you connect it? pls help unu

    • @CCLawhon
      @CCLawhon Год назад

      ​@@alejandraalcocer9857 @KetraGames and anyone else looking to add sound to these collectibles...I found a solution :) I made a tutorial here: ruclips.net/video/mA9UQwjykpk/видео.html ...basically just add a parent to your diamond and give that its own bigger collider, audio source, and the "Play Sound on Enter" script in the tutorial :)

  • @WornTraveler
    @WornTraveler 2 года назад

    Thanks for all the dope videos! 🙏 Keep it up, they are very helpful and everything is well explained, being a newb I dig that lol 😂

    • @KetraGames
      @KetraGames  2 года назад

      Thanks for this comment 😊

  • @galberger3937
    @galberger3937 9 месяцев назад

    Hi.
    can you show how to collect bullets, when the player press E with a canvas that shows the corrent amount of the bullets?

  • @zalatanypl9844
    @zalatanypl9844 2 года назад +1

    Simply Genius! Thx a lot!

    • @KetraGames
      @KetraGames  2 года назад

      Thanks fro this comment 😊

  • @MRBREAD1709
    @MRBREAD1709 Месяц назад

    when i did it the dimond tex and image did't show on the screen

  • @tigranavagyan5922
    @tigranavagyan5922 Год назад

    Thank you VERY MUCH for this video👍

  • @redna3699
    @redna3699 2 года назад

    What simple anda wonderful tutorial right there, But I have question. So how to make value of the diamond collected to somewhat larger than 1?

    • @KetraGames
      @KetraGames  2 года назад

      Thanks 😊
      If you wanted the diamond to increase the count by more than 1 you could change the line in the PlayerInventory. So rather than
      NumberOfDiamonds++;
      you could do
      NumberOfDiamonds+= 10;
      Hope that helps 😊

    • @redna3699
      @redna3699 2 года назад

      @@KetraGames it worked!!! Thank you very much

  • @Cricketdude69
    @Cricketdude69 Год назад

    great tutorial!

  • @redwes702
    @redwes702 2 года назад

    Hello,
    I have everything setup like in the video but when my character walks into the diamonds it does not collect them but they are solid instead and it just collides. It seems like a problem in my diamond script detecting player collision but everything is setup as in the video so I'm not sure what the issue is?

    • @kabhes9040
      @kabhes9040 2 года назад

      I had this problem a few minutes ago one child component in my diamond had a "collider" that didn't had "trigger" checked on.

  • @muhammadhabibulloh1596
    @muhammadhabibulloh1596 2 года назад

    please help me, I have followed the script but the diamonds don't disappear when they are taken 🙏🏻

    • @KetraGames
      @KetraGames  2 года назад

      Hi, does the diamond count on the screen go up even though they don't disappear? Are there any errors in the console?

    • @vmbrine
      @vmbrine 2 года назад

      @@KetraGames Hi ! I have the same problem than him, my character passes through the collectibles and it does send me an error 😢

    • @vmbrine
      @vmbrine 2 года назад

      And the « is Trigger » is clicked on so I really don’t know where the problem is coming from

    • @KetraGames
      @KetraGames  Год назад

      @vmbrine You said it does send you an error? Could you send the details of the error if there is one.
      Otherwise, it's a matter of debugging to see where the issue is. You can either put breakpoints in the code and step through if you know how to do that. Or you can add Debug.Log lines in to see where it gets to before it fails.

  • @frostymug3123
    @frostymug3123 2 года назад

    Great tutorial. I have encountered an issue however with the last step ... public UnityEvent OnPickUpCollected; is not exposed in the inspector even with adding [SerializeField]. From what I gather this is a unity bug, any thoughts on a work around?

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, I can't think of why it wouldn't be visible. Are you seeing any errors in the Console window?
      If you still can't get it to work, try copying the script form here - dotnetfiddle.net/Rzs92c
      Hope that helps 😊

    • @frostymug3123
      @frostymug3123 2 года назад

      @@KetraGames Thank you for the quick response! No errors in console. When researching this issue I found lots of posts claiming this was a unity bug issue with exposing unity events in the inspector. Some suggested you could get around this issue using [System.Serializable].
      The example is: "I have found the way.
      first you have to define your own event type (which is just a basic public class). however the custom event type must inherit from UnityEvent, like so."
      [System.Serializable]
      public class myFloatEvent : UnityEvent{}
      "then you can make variables from it, like so."
      [SerializeField]
      public myFloatEvent onChangeEvent;
      I'm just not sure how to refactor this to work with your example.

    • @KetraGames
      @KetraGames  2 года назад

      I've had a look into this and it seems this was an issue on earlier versions of Unity. What version are you using?

    • @Samael-lp3nk
      @Samael-lp3nk 2 года назад +1

      Hi thanks for the great tutorials. I'm getting the same error at this point also, i have the latest versions of unity and visual studio my character has [SerializedField] On a third person shooter controller. Not sure if this would have any effect?!🤷‍♂️

  • @豆豆開心
    @豆豆開心 21 день назад

    I followed the code all they way even copy and paste it but on the last step UpdateDiamondText did not show up

  • @bonse2000
    @bonse2000 2 года назад

    witch ipnut are u using old or new? its dowsnt work for me i havent errors on scripts bad my chr dsnt collect the diamonds

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, this is using the old input system. We're planning a video showing how to upgrade to the new system at some point in the future.

    • @bonse2000
      @bonse2000 2 года назад

      @@KetraGames cant wait for that thank you

  • @izzu7641
    @izzu7641 Год назад

    Hello , i have 3 object to collect and what should i do to collect it in order if 1 is not collected 2 is collected,then of 1 is collected and 2 collected?

  • @alperturan167
    @alperturan167 7 месяцев назад

    Another perfect tutorial by Ketra Games :) Thank you very much. May I ask a question: I've got two characters in the game but player can use both of them by swaping. I assigned the PlayerInventory script both of them and it works, BUT once the character#1 collects some diamonds and if I swap to the character#2 and collect any diamond then die diamond collection amount RESETS to 1.
    It seems Unity or the script keeps the amount for each character seperately, which is fine btw, but
    1st Question= how can I show the amount of diamond collection amount of each character on canvas seperately?
    2nd Question = how can I show the total diamond collection amount (without resetting) on the same canvas / text area?
    Many Thanks !

  • @DannyDoux
    @DannyDoux Год назад

    Hey, first of all i love your tutorials on unity, but i've been watching countless tutorials, blog posts and The unity guide and can't find anything about persistent collectable couter, how can i make it that when i collect 7 collectables in one level that i start the next one with 7?

    • @KetraGames
      @KetraGames  Год назад

      Hi, you would need to persist this between scenes. There are several options to do this. You can use a static variable, Unity's Player Prefs, or you can serialise to disk and load it back in again. Hope that helps 😊

    • @fernandoabalmedina6571
      @fernandoabalmedina6571 Год назад

      @@KetraGames hi i want that when i get to 10 diamonds the player go to next level scene 2, how i can make that happen?

  • @KBforJesusChrist
    @KBforJesusChrist 2 года назад

    How can I make an item spawn after collecting all objects (diamonds)

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, you would need to keep track of how many diamonds are left in the scene. You could write a script that gets the count of diamonds in the scene in the Awake method. Then subscribe to the diamond collected event and decrease this count each time. Once you reach zero you can initialise the object you want. Hope that helps 😊

    • @KBforJesusChrist
      @KBforJesusChrist 2 года назад

      @@KetraGames it's like i want an item to spawn at a certain location after a player collects 7 diamonds i made a parkour game that you can only win by collecting a special item but i want that item to only spawn when you collect a specific amount of gems .
      I'm a beginner with no knowledge of coding but I'm halfway done with my game I'm making with just tutorial

  • @sherlockholmes374
    @sherlockholmes374 Год назад

    Hi there! What if I want the diamonds to spawn randomly during the day?

  • @shang_psycho7414
    @shang_psycho7414 2 года назад +1

    This helped, thanks!

    • @KetraGames
      @KetraGames  2 года назад +1

      👍😊

    • @shang_psycho7414
      @shang_psycho7414 2 года назад

      @@KetraGames It still worked even though I wasn't using diamonds as the object.

    • @shang_psycho7414
      @shang_psycho7414 2 года назад

      @@KetraGames Do you know how to make it so that when all the items are collected, a scene changes or something?

    • @KetraGames
      @KetraGames  2 года назад +1

      ​@@shang_psycho7414 Hi, you would need to keep track of how many collectables are still active in the scene. Once you reach zero then you can trigger the scene change.

    • @shang_psycho7414
      @shang_psycho7414 2 года назад

      @@KetraGames Ok. If I can't figure out how to do that, I'll try something else. Thanks for the advice.

  • @JPMjeremy
    @JPMjeremy Год назад

    Amazing video!

  • @aleksandraaleksandra7934
    @aleksandraaleksandra7934 2 года назад

    At the very beginning: big hugs to you💚! You do wonderful tutorials for beginners, I learn a lot from your videos. Thank you!
    I used this video to add scripts to an existing project that I have been working on for a while. I already have a canvas for Game Over.
    I did what you did in this video, no bugs, player can collect diamonds but unfortunately nothing is charged on the canvas. I watched the tutorial again and I don't know where the error may be. I know it's hard to answer something "out of the head", but maybe someone has an idea?🙄

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, glad you're finding the videos useful. Have you set up the event handler in the Inspector to update the canvas when a diamond is collected? If so, it might be worth adding a Debug.Log line in the method you're calling from the event handler, to make sure it is getting called. Hope that helps 😊

  • @azzamrashid3726
    @azzamrashid3726 Год назад

    4:25 //use override

  • @cropoxz
    @cropoxz 2 месяца назад

    When I walk over the "diamonds" they don't get collected :/ anyone know why?

  • @HansChristian-bj2pt
    @HansChristian-bj2pt 2 года назад

    Great tutorials. However im runing into an error with this one, even if i copy your code from the fiddle link.
    ArgumentException: Object of type 'UnityEngine.Object' cannot be converted to type 'PlayerInventory'.
    I get this error when i implement the last steps. Everything works fine up till then. The gems gets picked up and removed but at soon as i want to send the number of gems to the UI i get the error. And only when i attempt to pick up the gems.

    • @KetraGames
      @KetraGames  2 года назад

      Hi, can you check that when you trigger the event in the PlayerInventory script, that you're passing through 'this'
      OnDiamondCollected.Invoke(this);
      That should pass the PlayerInventory through to the UI script.
      If that doesn't work you could try changing the event to just be a general event
      public UnityEvent OnDiamondCollected;
      Then when you wire up the event in the Inspector, there should be an extra slot for the PlayerInventory that you can drag the Player object into.
      Hope that helps 😊

  • @Lerde
    @Lerde 2 года назад

    Great video...what if i want diamonds to be collected for example 20 and then congratulations on passing a level?

    • @KetraGames
      @KetraGames  2 года назад

      Hi, you would need to create another script to do this. You could still hook up the diamond collected event to this new script but check if the total has reached 20 before making the text visible. Hope that helps 😊

  • @MetaDataAutomation
    @MetaDataAutomation 2 года назад

    Hiya,
    Thanks for the nice video, was easy to follow. Bit of a plot twist for me though - I'm using 2D so maybe that's the problem.
    Basically I have a fireball that comes down and I want my character to collect it. The fireball has a rigidbody, circular collider and bouncy physics. When it hits my dragon it doesn't get collected - any ideas?

    • @KetraGames
      @KetraGames  2 года назад

      Hi, have you marked the collider as a trigger?

  • @Bornholm-Roenne
    @Bornholm-Roenne 2 месяца назад

    On Diamond Collected PlayerInventory the update name you said I cant find it. TextmeshProUGui.UpdateFontAsset is the one I can pick?

    • @KetraGames
      @KetraGames  2 месяца назад

      Hi, I'm not sure why it wouldn't be showing. Have you compared your script to the one here
      dotnetfiddle.net/Rzs92c

  • @terablue80
    @terablue80 2 года назад

    HIIII! Amazing tutorial! Do you think this is doable on an AR game? I'm trying to figure out if there's any possibility to collect an AR element and put it into an inventory (ideally on click as it is an android app) yet I didn't manage to find any tutorial on this topic :( Any advice? Thanks!

    • @KetraGames
      @KetraGames  2 года назад

      Hi, sorry I've not looked into AR functionality in much detail. I'd have thought it was possible though

  • @mxbshr4276
    @mxbshr4276 Год назад

    my fpc character just runs straight through the gems, i followed your code exactly and i cannot get it to work

    • @KetraGames
      @KetraGames  Год назад

      Hi, do you see any errors in the console window?

  • @Rovtar_
    @Rovtar_ 2 года назад

    How to move box collider?

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, the box collider position is linked to the transform of the object it is attached. You can change the center position to offset it however you want. Hope that helps 😊

  • @vimalv2312
    @vimalv2312 2 года назад

    Where to add this scripts in first person play ?!

  • @davisardians8411
    @davisardians8411 2 года назад

    great tutorial. can i request tutorial "trigger a dialog with npc"?

    • @KetraGames
      @KetraGames  2 года назад

      Thanks for the suggestion. We'll add it to the list of future videos 😊

  • @nega-guy
    @nega-guy Год назад +1

    Hi, I have a problem. I have all the scripts copied and put into the correct objects but there's something wrong. When I go to my character the Player Inventory script doesn't show the thing where I can select the function of OnDiamondCollected. Plus, when I try to test the game and grab the collectables it just throws me this error:
    "NullReferenceException: Object reference not set to an instance of an object PlayerInventory.DiamondCollected () (at Assets/PlayerInventory.cs:13)
    Diamond.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Diamond.cs:13)"
    By the way, I'm using Unity 2019.4.40f1 Personal. Maybe that has something to do? If you can help I'd thank you a lot.

  • @tangaroranguzzikeirb.9264
    @tangaroranguzzikeirb.9264 Год назад

    how to collect the diamond in order like in diamond1 diamond 2 diamond 3 , if diamond 1 one is collected you cannot collect the diamond 2 and diamond 3.

  • @BjornBrnk
    @BjornBrnk 8 месяцев назад

    Please help! This was an awesome tutorial, but I can't find 1 thing on the internet that explains how to load next scene if all objects are collected!!!

  • @muhammadjonyangiboyev951
    @muhammadjonyangiboyev951 10 дней назад +1

    thanks

  • @luliii123
    @luliii123 Год назад

    Super helpful 🤩

  • @PrincedeepKaur-f9n
    @PrincedeepKaur-f9n Год назад

    Thankyou so much.

  • @hballamco
    @hballamco 2 года назад

    A beginner question, in the "InventoryUI" script,
    why did you put argument for the "UpdateDiamondText" method?
    What was the source of that argument to make the method work?
    Thank you,

    • @KetraGames
      @KetraGames  2 года назад

      Hi, the UpdateDiamondText uses the PlayerInventory parameter to get the number of diamonds that have been collected.
      playerInventory.NumberOfDiamonds.ToString();
      This is passed through when the event is invoked from the PlayerInventory.
      OnDiamondCollected.Invoke(this);
      In this case 'this' refers to the PlayerInventory invoking the event.
      Hope that makes sense 😊

    • @hballamco
      @hballamco 2 года назад

      @@KetraGames I see, thanks a lot

  • @darkprinc3284
    @darkprinc3284 2 года назад

    life savior

  • @alfredb.4485
    @alfredb.4485 2 года назад

    Perfect! "thx you";

  • @CCLawhon
    @CCLawhon Год назад

    If you are looking to add sound to these collectibles where it plays once...I found a solution :) I made a tutorial here: ruclips.net/video/uazpON_0JdA/видео.html (Edited because the parent object sound didn't always work, and you couldn't keep it from playing anytime you entered the area even if collectable was gone).
    ...basically just add a sound object on top of the collectable... and give that its own collider, audio source, and the "Play Sound on Enter" script in the tutorial :)​ I got the sound script from @ChrisTutorialsYT ruclips.net/video/E7-HAJ4Db64/видео.html, then I added a bool for "if already played".

  • @DiGiFanboy
    @DiGiFanboy Год назад

  • @nimomaniachannel
    @nimomaniachannel 2 года назад

    QUESTION:
    Are the public class names just the name of the C# script. For example,
    public class PlayerInventory : Monobehaviour;
    because the filename is called PlayerInventory.

    • @KetraGames
      @KetraGames  2 года назад +1

      Hi, yes, usually the name of the file is the same as the name of the class.

  • @dimassuhada1230
    @dimassuhada1230 2 года назад +1

    Thank uu

  • @mamtapatil1892
    @mamtapatil1892 2 года назад +1

    How we can spawn diamonds randomly on terrain, please help 😊

    • @KetraGames
      @KetraGames  2 года назад

      Hi, you could generate a navmesh for the walkable area of your terrain. Then you could find random points on the navmesh to place diamonds. This link may help answers.unity.com/questions/475066/how-to-get-a-random-point-on-navmesh.html

    • @mamtapatil1892
      @mamtapatil1892 2 года назад

      @@KetraGames Thank you for replying so quickly. Actually you know what, i am a total beginner and i have to submit my project after 2 days. So can you please make a quick video on this topic i am sure many us want a video on topic. Please

  • @sajjadkhan2858
    @sajjadkhan2858 2 года назад

    I had requested you to make tutorial on how we can access our collected coins from other scenes...

    • @KetraGames
      @KetraGames  2 года назад

      Hi, we've added it to the list to cover in a future video 👍

  • @fazyrajput7999
    @fazyrajput7999 10 месяцев назад

    Thanksalot

  • @JejoGames-b7x
    @JejoGames-b7x Год назад

    a me non va