From Beginner to Pro: Mastering Unity's Colliders

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 44

  • @anandev
    @anandev  ปีที่แล้ว +7

    Sorry for the loud sound effects 😭
    That's it.
    Have a beautiful day :)

  • @darioz8241
    @darioz8241 หลายเดือนก่อน +1

    Your explanations about Colliders and Rigidbody are pure gold, thank you so much

    • @anandev
      @anandev  หลายเดือนก่อน +1

      Thank you so much! This made me so happy! 🥹❤️ I'm glad the video was useful!

  • @reddead1668
    @reddead1668 9 หลายเดือนก่อน +6

    Criminally underrated unity game dev youtube channel
    Love the tutorials

    • @anandev
      @anandev  9 หลายเดือนก่อน +1

      Thank you so much!!! This means a lot 😭❤️

  • @yawnyawning
    @yawnyawning 10 หลายเดือนก่อน +2

    im using Unity nearly ten years and this is one of the best tutorial ive ever seen

    • @anandev
      @anandev  10 หลายเดือนก่อน +1

      Thank you soo much!!! This means a lot ♥️

  • @bgoldpanda7265
    @bgoldpanda7265 8 หลายเดือนก่อน +2

    Great video! Going to implement the use of collision matrix now, I was struggling with an easy way to do this before I saw your tutorial. Keep up the great work Anan!

    • @anandev
      @anandev  7 หลายเดือนก่อน

      Thank you so much!! I'm glad the video was useful! 😊 Collision Matrix is a really powerful tool, and it effectively eliminates unwanted interactions with ease. If you want, there's a video on my channel for collectibles, which uses this collision matrix to simplify collisions even further!

  • @SepiaDragoonGR
    @SepiaDragoonGR 9 หลายเดือนก่อน +2

    This is literally a wealth of experience and knowledge, thank you very much Sir

    • @anandev
      @anandev  9 หลายเดือนก่อน +1

      Thank you so much!! I'm glad I'm doing what I'm doing! So nice of you!

    • @SepiaDragoonGR
      @SepiaDragoonGR 9 หลายเดือนก่อน +1

      @@anandev by any chance, I am working on a 3D space adventure game. Would you be interested in a collab?

    • @anandev
      @anandev  9 หลายเดือนก่อน

      @@SepiaDragoonGR I would love to collab! What kind of work are we talking about?

  • @devSSEM
    @devSSEM ปีที่แล้ว

    You made one of the best Unity tutorials I've ever seen.😍

    • @anandev
      @anandev  ปีที่แล้ว

      Wow, thanks! I'm happy it was useful 🐼

  • @bigedwerd
    @bigedwerd ปีที่แล้ว +1

    This deserves more views. So concise! One way you could have gotten around the compound collider for your character is to create an empty object in the hierarchy of your player with a tag of "PlayerPresence" and a trigger capsule collider then check if the door has OnTriggerEnter/Exit with that tag. Your example is good if you want to be more precise, but in the case of the door you probably don't need to be.

    • @anandev
      @anandev  ปีที่แล้ว +1

      Woah! That makes total sense. I'm not sure whether triggers could trigger OnTrigger events with other triggers 😵
      Btw, I'm glad you liked my video 🥰🌱

    • @bigedwerd
      @bigedwerd ปีที่แล้ว +1

      @@anandev I tested it out to be sure and got it to work. I made a rudimentary model with a body and limbs all with "Player" and then the trigger with "PlayerPresence" I mentioned. I've been using more empty game objects lately for simple things like spawning a cannonball out of a cannon rather than doing funky math.
      Your approach is very necessary for different situations and a great reminder on how the system works.
      Your videos are awesome! I just discovered your channel so I'm looking forward to checking out the rest.

    • @anandev
      @anandev  ปีที่แล้ว +1

      @@bigedwerd That idea is definetely a simple game changer for me. Defenitely helps with not overthinking and complicating things 😂
      And I'm glad my vids are helpful! Thank you very muchhh

  • @Tormator
    @Tormator ปีที่แล้ว

    Thank you for your video, clear, concise and very educational. Almost always, we think that because they are basic topics they are not so important, but they really are.
    I just discovered your channel and I find your content very good. Great job!

    • @anandev
      @anandev  ปีที่แล้ว

      Woah! This made my day! Thank you sooo muccchhhh

  • @dusklightcreations3951
    @dusklightcreations3951 ปีที่แล้ว +2

    The best video i stumbled upon .you earned a sub bro,the only request i would have is upload frequently and stick to the topics like this and can you tone down sound effects a bit low .

    • @anandev
      @anandev  ปีที่แล้ว

      Thank you so much! I try my best to upload, but life keeps throwing rocks at my way. And yes, I forgot to tone the sound effects down. Honest mistake :)

  • @jellystump2417
    @jellystump2417 หลายเดือนก่อน +1

    Wow you explain thing sooo good, Thank uu

    • @anandev
      @anandev  หลายเดือนก่อน

      Thank you so much this means a lot ❤️

  • @NewG_JL
    @NewG_JL ปีที่แล้ว +1

    Here before this channel blows up!!

    • @anandev
      @anandev  ปีที่แล้ว

      Me shall remember this 🐼 thank you so much

  • @Spyboticer
    @Spyboticer ปีที่แล้ว +1

    Been having a hard time with my collisions in my prototype,this vid might have been the answer to my issues😂

    • @anandev
      @anandev  ปีที่แล้ว

      Yo I'm glad this could help ☺😬

  • @v0ltdev
    @v0ltdev ปีที่แล้ว +2

    To not get performace hit if you use the getComponent function and returns null use the tryGetComponent function instead which returns a boolean if the component you are looking for is null or not and outputs it if it isnt without any performance hits if its not

    • @anandev
      @anandev  ปีที่แล้ว

      Yes TryGetComponent() works. I looked into it, but I couldn't find any actual evidence for the performance gain anywhere online. But yeah it does makes sense and maybe faster.

    • @anandev
      @anandev  ปีที่แล้ว

      Thanks for sharing this! 🥰

    • @v0ltdev
      @v0ltdev ปีที่แล้ว +2

      @@anandev visual studio's intellisense tells you that

    • @anandev
      @anandev  ปีที่แล้ว

      @@v0ltdev For real? I haven't noticed lol 😂

  • @fokeyjo
    @fokeyjo 8 หลายเดือนก่อน +1

    Regarding your problems with the door, why did you not use a separate trigger collider for area interactions like that?
    Also, I'm no games pro, but I wonder if it's more efficient to disable the detailed composite collider whilst there's nothing nearby to interact with, just have a larger encompassing trigger collider that when anything of interest is nearby it switches the detailed mesh on. Maybe then you wouldn't even need the composite collider operating? Probably overkill or causes a delay turning it on/off all the time - and depends on the game, of course.

    • @anandev
      @anandev  8 หลายเดือนก่อน

      If I use a separate collider on the body itself, it becomes a part of the compound collider. The compound colliders needs a Rigidbody and a collider on the root GameObject, and if we try to make it a huge capsule, then it will also trigger collisions like every other collider in the body and disabling such a collider may not be a wise thing to do especially since it's on the root GameObject 😅
      The idea you suggested would probably work, but I think it takes too much memory, and you need to manually place the area of interest triggers and stuff like that.
      Instead, I would recommend finding a solution through code, just like I did in the video, the CPU does it pretty fast, and I think it's way better (in the long run) and you only need to solve it once! There is a lot of memory usage that could be avoided if we spend some time doing the code.
      However I would recommend creating a function or something in the character script itself like IsTouchingCollider() or something like that, so that you don't have to write it again and again for every interaction.

  • @Abdel-Qader
    @Abdel-Qader ปีที่แล้ว +1

    you are doing great work .. keep up ..
    can you make a video about how is unity working in background
    i mean what is the main class in unity and what is mean by namespace and this stuff
    thanks

    • @anandev
      @anandev  ปีที่แล้ว

      Thank you so muchh!!!
      Well, there is no single "main" class in Unity. It works when a lot of classes work together. I will see what I can do for a video about it. Will need to research.
      I definetely can make a video about namespaces, and I'll add it to my priorities.
      Once again, thank you so much for being a part of the gang

  • @BbVortexMortinghan
    @BbVortexMortinghan 8 หลายเดือนก่อน +1

    Good video

    • @anandev
      @anandev  8 หลายเดือนก่อน +1

      Thank you so much! I'm glad it was useful!

  • @jean-loupmartin6067
    @jean-loupmartin6067 ปีที่แล้ว +1

    Very cool vidéo ! The sound effects are a bit too loud for me :)

    • @anandev
      @anandev  ปีที่แล้ว

      Thank you! Sorry about the sound effects volume, I'll tone it down for the next one ☺

  • @andisarifi5805
    @andisarifi5805 9 หลายเดือนก่อน +1

    2:45 KILLED ME HAAHAHAHAHAH

    • @anandev
      @anandev  9 หลายเดือนก่อน

      Haha! 😂 Humour based on my pain 😭