Unity Collision Cheat-Sheet - Discrete vs Continuous

Поділитися
Вставка
  • Опубліковано 1 лип 2024
  • Each collision mode offers a unique collision mechanic. Knowing which one to use is key for solid gameplay and performance.
    Discrete is the most performant option and should be used whenever possible. Calculations collisions each fixed step.
    Continuous uses a sweeping algorithm to guarantee collisions from a linear motion, but is quite a bit more expensive than discrete and only hits static colliders (no RB).
    Continuous dynamic is the same as continuous, but hits dynamic colliders (and is more expensive).
    Continuous speculative creates a bounding box around itself and its next projected frame position according to its current linear and angular motion. Anything caught within will collide.
    ❤️ Become a Tarobro on Patreon: / tarodev
    =========
    🔔 SUBSCRIBE: bit.ly/3eqG1Z6
    🗨️ DISCORD: / discord
    ✅ MORE TUTORIALS: / tarodev
    0:00 Discrete
    0:40 Continuous
    1:05 Continuous Dynamic
    1:25 Continuous Speculative

КОМЕНТАРІ • 197

  • @MasterDavicous
    @MasterDavicous Рік тому +224

    A fun trick I like to use in some instances is stretch the projectile's collider according to its velocity. This way it still detects collisions at high speeds on discrete mode! :)

    • @Tarodev
      @Tarodev  Рік тому +61

      Oh wow, that's an awesome little trick!

    • @alex.g7317
      @alex.g7317 Рік тому

      sick

    • @joscpe
      @joscpe Рік тому +7

      I know a thing or two about stretchy projectiles

    • @alex.g7317
      @alex.g7317 Рік тому

      @@joscpe Is this a dick joke?

    • @JuniorDjjrMixMods
      @JuniorDjjrMixMods Рік тому +4

      Scale a collider is costly iirc. Maybe the cost is higher than the benefit.

  • @iHeartGameDev
    @iHeartGameDev Рік тому +34

    Never pressed a notification so fast! Welcome back, Taro!!

  • @dragonlance1121
    @dragonlance1121 Рік тому +71

    Nice! I have wondered about this for a while. There are so many Unity options that have no explanation tips, you could make a dozen videos like this easily, and I'd watch every one of them. By the way, you are mentioned in the Credits section of the game I am making, for all your great tutorials. Thanks!

    • @Tarodev
      @Tarodev  Рік тому +23

      I'd love to play it when you're done. Come to discord and drop it in when you're ready :)

  • @neilmarkcorre5524
    @neilmarkcorre5524 Рік тому +21

    Straight to the point, impressive and easy-to-understand visuals, concise - overall a brilliant video! This deserves to be shared EVERYWHERE.

  • @EngineersToGoMT
    @EngineersToGoMT 2 місяці тому +1

    Broooo !!! this here was helpfull. I didn't even know what was going on with my objects going through walls. This was too helpful

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

      Glad it helped you my man

  • @x-easy
    @x-easy Рік тому +18

    This is awesome! Daniel Irving had a good idea; putting you in the credits section of my upcoming game. Thanks a ton for what you do!

    • @Tarodev
      @Tarodev  Рік тому +6

      I would be honoured to be in there ❤️ as I said to him, be sure to drop your game in discord so I can check it out.

  • @NoTimeLeft_
    @NoTimeLeft_ Рік тому +2

    The quest for quaternions has envelopes tarodev so utterly completely, he may never be the same again.

    • @Tarodev
      @Tarodev  Рік тому +2

      Very VERY soon my friend

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

    This... I have wall boundaries in my project, it's rare but sometimes when something moves too quickly they go through the wall. YT recommending this was so timely.

  • @MaksMikhnevych
    @MaksMikhnevych Рік тому +6

    Here! That's some high quality content in here! Was missing you, good job!

    • @Tarodev
      @Tarodev  Рік тому +2

      Thanks for waiting 🙏

  • @petpumpkin
    @petpumpkin Рік тому +6

    This is great, I'd love to see more dives into what the settings of components actually do

  • @Subreeze102
    @Subreeze102 Рік тому +4

    Great execution on the short but informative cheatsheet video!

  • @PitiITNet
    @PitiITNet Рік тому +1

    So good to have another of your videos :)! I missed you already :D

  • @Chubzdoomer
    @Chubzdoomer Рік тому +1

    One of the best breakdowns of the collision types I've ever seen. Fantastic work as usual (and another great reminder why I've stayed subscribed to this gem of a channel)!

  • @Beldarak
    @Beldarak Рік тому +2

    Thanks. I never took the time to ask myself what different modes did. super helpful and straight to the point :)

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

    Great explanation! Lots of useful information, delivered in under 3 minutes. Bravo!

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

    Great timing, my current unity project sometimes has collision issues, and I expect it's related to discrete collisions. Thanks for the video

  • @ChristinaCreatesGames
    @ChristinaCreatesGames Рік тому +2

    Oh, cool, I had wondered about this recently. Good explanation and I love your visuals =)

  • @hamedbabamohamadi9017
    @hamedbabamohamadi9017 Рік тому +2

    Missed you! glad to watch another amazing video from you.

  • @wayward8372
    @wayward8372 7 місяців тому +1

    Further to another comment - this video gives clarity, with clear, easy to understand visuals and example use cases and concise. Great.

  • @LawZist
    @LawZist Рік тому +1

    Short and to the point! Very informative. Thanks

  • @rungrukuk
    @rungrukuk Рік тому +1

    Your tutorials definitely underrated

    • @Tarodev
      @Tarodev  Рік тому +1

      Appreciate it kamal 🙏

  • @ayushsidam289
    @ayushsidam289 Рік тому +1

    Thanks Taro I'm beginner and always used continuous collision before. This video changed my mind. 😀🙌🏻

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

    The legend returned. Glad to see you back with such a qualitative content🔥

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

    This channel is piece of gem! Fast, simple, but explain enough to understand by almost everyone! I just love it.

    • @Tarodev
      @Tarodev  Рік тому +1

      Had me worried reading "a piece of...".
      Glad you like it 😀😀

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

    Awesome! We're still waiting for quaternions though, please don't leave us hanging 🙏

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

    You are a f@@ legend! You explain everything very well and keep it small and simple. Keep the good work man!

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

    Concept explanation and video quality 13/10! Would watch again!

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

      That's a high rating my man

  • @2PANZER2
    @2PANZER2 Рік тому +2

    nice short video for beginners
    also you can make about collisions. When does happen ontriggerenter/oncollisionenter, what difference and etc

  • @MattSimon1
    @MattSimon1 Рік тому +2

    Short and sweet. Love it!

  • @tansangle7226
    @tansangle7226 Рік тому +1

    Woah, great video mate!

  • @ojassharma56
    @ojassharma56 Рік тому +1

    Just brilliant, and so helpful. I would recommend these anyday to my junior devs who can learn from you just like once I did, and I keep learning from you everyday since

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

    Best explanation I've seen by far. Keep up the good work!

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

    Beautiful presentation! It was so informative and concise.

  • @aliengarden
    @aliengarden Рік тому +2

    Great video, as always!

  • @CtrlAltPotato
    @CtrlAltPotato Рік тому +1

    I can see myself coming back to this video when I'm doing collisions in my games.

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

      That was the exact thought I had in mind when making this video 😉

  • @ThiccyDev
    @ThiccyDev Рік тому +2

    Tarogoat with another banger upload ngl🐐

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

    That was such an excellent visual! So incredibly helpful1

  • @aryajohary5922
    @aryajohary5922 Рік тому +1

    That Byeeeeeee was fun..😂

  • @MaskedImposter
    @MaskedImposter Рік тому +2

    I had a tunneling issue with a parabolic projectile tunneling through the ground. I just decided to increase the size of its collider.

  • @ShinichiKudoQatnip
    @ShinichiKudoQatnip Рік тому +2

    Woah, now this bite size info will go a looooong way for me. ❤️

  • @maxhuk
    @maxhuk Рік тому +1

    Nice breakdown!

  • @ceroenblanco
    @ceroenblanco Рік тому +1

    Things I didn't know I didn't know. Thank you!

  • @YasserSedrati
    @YasserSedrati Рік тому +1

    Great as always!!!

  • @ewwitsantonio
    @ewwitsantonio Рік тому +1

    Yay another tarodev video!

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

      Kept you waiting ;)

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

    Now this is what we call "Back with a Bang"
    Missed your videos...

  • @jean-michel.houbre
    @jean-michel.houbre Рік тому +1

    Very clear, thanks.

  • @pixelsoupgames
    @pixelsoupgames Рік тому +1

    Thank you, this is great info provided quickly

  • @Paul-Jean
    @Paul-Jean Рік тому +1

    It is very well explained. Very useful cheat sheet, thanks. (The video support helps me understand better than just pictures and text.)
    Otherwise, I wonder, for the thumbnail image of this video, what type of font you are currently using? I love this typography.

    • @Tarodev
      @Tarodev  Рік тому +1

      It's called 'You Blockhead'. It's the same font supercell uses. You can buy a license pretty cheap.

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

    thanks, it actually let me through so i could download it.

  • @wicgamesdev
    @wicgamesdev Рік тому +1

    Thank for the knowledge mate

  • @veuch_
    @veuch_ Рік тому +1

    Huh, that's pretty handy ! Thanks ! :)

  • @rathodketan5551
    @rathodketan5551 Рік тому +1

    yes please make videos like this we love it thank you

  • @landixus
    @landixus Рік тому +2

    After 10 years, i understand it :)

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

    it worked! thank you so much!!

  • @This-Was-Sparta
    @This-Was-Sparta Рік тому +1

    That's some good knowledge, thanks.

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

    ITS REALLY WORKED LOL THANK YOU DUDE

  • @FoolishCrow
    @FoolishCrow Рік тому +1

    Thank you for the explanation.

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

    awesome explanation, thank you

  • @murftg
    @murftg Рік тому +1

    king has returned

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

      Thanks for waiting on me 🙏

  • @IAmYes.
    @IAmYes. Рік тому +1

    Amazing visuals!!!!

  • @Fiiloret
    @Fiiloret Рік тому +1

    Finely the best describe of this options

  • @shoco2
    @shoco2 Рік тому +1

    Great video!

  • @Damiano401
    @Damiano401 Рік тому +1

    Great explanation

  • @PriyadarshiPrashant
    @PriyadarshiPrashant Рік тому +1

    welcome back 🙂🙂

  • @erikkaramian8005
    @erikkaramian8005 Рік тому +1

    Thanks for the video

  • @_g_r_m_
    @_g_r_m_ Рік тому +1

    He's back!

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

      Never left baby
      ... maybe a little

  • @castlecodersltd
    @castlecodersltd Рік тому +1

    Very good, thanks

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

    awesome explanation. thank you =)

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

    Very helpful, thanks.

  • @googleuser4720
    @googleuser4720 Рік тому +1

    Succinct and to the point. I like it

  • @awesomemike3857
    @awesomemike3857 Рік тому +1

    Thank you for this

  • @OfflineOffie
    @OfflineOffie Рік тому +2

    Nice quick explanation!
    _But where's the promised Quaternion video Taro, hmm?_

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

      Oh yeah... that. Just around the corner

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

    Watched a few of your vids this weekend, and really wish I discovered your channel a few years back. Very interesting, your awesome ;-) Also good to hear a familiar accent on youtube

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

      I wasn't here a few years back 😂

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

      Fair enough. Still, excellent channel. Im planning on making a few changes to how I code thanks to you ;-)@@Tarodev

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

      @@randomragtags Glad I could help buddy. Good luck on your journeys!

  • @truth8483
    @truth8483 Рік тому +1

    these videos are so great.

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

    For the problem of ghost collisions with rotaion in speculative mode one solution that I can think of is to lag the collider of the rotating object based on its speed, so that when it ghost collides the actual mesh would be leading the collider.

  • @enescetinn
    @enescetinn Рік тому +1

    Just awesome!

  • @Algost_
    @Algost_ Рік тому +1

    More like this plz ! Thx

  • @bluzenkk
    @bluzenkk Рік тому +1

    thanks for the info.

  • @calvinms7503
    @calvinms7503 Рік тому +1

    THANKS!

  • @NunSuperior
    @NunSuperior Рік тому +1

    Super useful.

  • @mayankbhaisora2699
    @mayankbhaisora2699 Рік тому +1

    Wizard is back

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

    This is the best free software Ive seen. Respect.

  • @Ghareebz
    @Ghareebz Рік тому +1

    great video

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

    Great video

  • @notDiru
    @notDiru Рік тому +1

    what an extraordinary explanation!

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

      Thanks stranger

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

      @@Tarodev 😨😭😭😭😭😭😭

  • @Zooloo007
    @Zooloo007 Рік тому +2

    Wow thanks your the best!

  • @alex.g7317
    @alex.g7317 Рік тому +1

    I love the tips!

  • @Hazzel31337
    @Hazzel31337 Рік тому +1

    verry good and verry informativ

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

    thanks!

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

    Very helpful video! Thank you!

  • @hossein818
    @hossein818 Рік тому +1

    best as ever

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

    I use Physics.OverlapBox as the collider. This never misses (at least until now). I don't know about its performance, but I only make mobile games and never had an issue

  • @kineticconundrum
    @kineticconundrum Рік тому +1

    ty

  • @onurcanbiricik9291
    @onurcanbiricik9291 Рік тому +1

    GOD!!!My broo

  • @midniteoilsoftware
    @midniteoilsoftware Рік тому +4

    Nice but I want to see more on the new multiplayer services :)

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

    Great vid, seams really helpful but dude... what happened to the quaternion vid? xD

    • @Tarodev
      @Tarodev  Рік тому +1

      Oh mate, any day now

  • @jahoopyjaheepu497
    @jahoopyjaheepu497 Рік тому +1

    Great video!
    The tradeoffs with traditional Rigidbody collisions are why I almost always opt to write my own collision detection and resolution using a Kinematic Ridigbody.

  • @babbycakes173
    @babbycakes173 Рік тому +2

    that is a great video

  • @DevDunkStudio
    @DevDunkStudio Рік тому +1

    Thanks!
    Idk why, but this info is hard to find

    • @Tarodev
      @Tarodev  Рік тому +1

      Sounds like the perfect reason to make a video 😊

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

      @@Tarodev definitely! Hope it does well

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

    What is the best option to use in the case of a bullet-hell game or a game where a player may mod their weapons to fire 10s of projectiles per second, with 100s on screen?
    Ray Cast per projectile? Or the built in collider solution?
    I've attempted the raycast option before, but always had tunneling as well (as if the projectile just never "hit"), but with much better performance than rigidbody/colliders. I raycasted from the projectile, forward by units equal to the "travel speed" of the projectile, and even slow projectiles would occasionally just act like the ray cast missed