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
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! :)
Oh wow, that's an awesome little trick!
sick
I know a thing or two about stretchy projectiles
@@joscpe Is this a dick joke?
Scale a collider is costly iirc. Maybe the cost is higher than the benefit.
Never pressed a notification so fast! Welcome back, Taro!!
Never pressed the like Button on a coment so fast ! Xd Hi IHGD
Awww, thanks Nicky
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!
I'd love to play it when you're done. Come to discord and drop it in when you're ready :)
Straight to the point, impressive and easy-to-understand visuals, concise - overall a brilliant video! This deserves to be shared EVERYWHERE.
Broooo !!! this here was helpfull. I didn't even know what was going on with my objects going through walls. This was too helpful
Glad it helped you my man
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!
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.
The quest for quaternions has envelopes tarodev so utterly completely, he may never be the same again.
Very VERY soon my friend
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.
Here! That's some high quality content in here! Was missing you, good job!
Thanks for waiting 🙏
This is great, I'd love to see more dives into what the settings of components actually do
Great execution on the short but informative cheatsheet video!
So good to have another of your videos :)! I missed you already :D
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)!
Thanks. I never took the time to ask myself what different modes did. super helpful and straight to the point :)
Great explanation! Lots of useful information, delivered in under 3 minutes. Bravo!
Great timing, my current unity project sometimes has collision issues, and I expect it's related to discrete collisions. Thanks for the video
Oh, cool, I had wondered about this recently. Good explanation and I love your visuals =)
Missed you! glad to watch another amazing video from you.
Further to another comment - this video gives clarity, with clear, easy to understand visuals and example use cases and concise. Great.
Short and to the point! Very informative. Thanks
Your tutorials definitely underrated
Appreciate it kamal 🙏
Thanks Taro I'm beginner and always used continuous collision before. This video changed my mind. 😀🙌🏻
The legend returned. Glad to see you back with such a qualitative content🔥
This channel is piece of gem! Fast, simple, but explain enough to understand by almost everyone! I just love it.
Had me worried reading "a piece of...".
Glad you like it 😀😀
Awesome! We're still waiting for quaternions though, please don't leave us hanging 🙏
You are a f@@ legend! You explain everything very well and keep it small and simple. Keep the good work man!
Concept explanation and video quality 13/10! Would watch again!
That's a high rating my man
nice short video for beginners
also you can make about collisions. When does happen ontriggerenter/oncollisionenter, what difference and etc
Short and sweet. Love it!
Woah, great video mate!
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
Aww
Best explanation I've seen by far. Keep up the good work!
Beautiful presentation! It was so informative and concise.
Great video, as always!
I can see myself coming back to this video when I'm doing collisions in my games.
That was the exact thought I had in mind when making this video 😉
Tarogoat with another banger upload ngl🐐
🐐
That was such an excellent visual! So incredibly helpful1
That Byeeeeeee was fun..😂
I had a tunneling issue with a parabolic projectile tunneling through the ground. I just decided to increase the size of its collider.
Woah, now this bite size info will go a looooong way for me. ❤️
Nice breakdown!
Things I didn't know I didn't know. Thank you!
Great as always!!!
Yay another tarodev video!
Kept you waiting ;)
Now this is what we call "Back with a Bang"
Missed your videos...
Very clear, thanks.
Thank you, this is great info provided quickly
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.
It's called 'You Blockhead'. It's the same font supercell uses. You can buy a license pretty cheap.
thanks, it actually let me through so i could download it.
Thank for the knowledge mate
Huh, that's pretty handy ! Thanks ! :)
yes please make videos like this we love it thank you
After 10 years, i understand it :)
it worked! thank you so much!!
That's some good knowledge, thanks.
ITS REALLY WORKED LOL THANK YOU DUDE
Thank you for the explanation.
awesome explanation, thank you
king has returned
Thanks for waiting on me 🙏
Amazing visuals!!!!
Finely the best describe of this options
Great video!
Great explanation
welcome back 🙂🙂
Thanks for the video
He's back!
Never left baby
... maybe a little
Very good, thanks
awesome explanation. thank you =)
Very helpful, thanks.
Succinct and to the point. I like it
Thank you for this
Nice quick explanation!
_But where's the promised Quaternion video Taro, hmm?_
Oh yeah... that. Just around the corner
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
I wasn't here a few years back 😂
Fair enough. Still, excellent channel. Im planning on making a few changes to how I code thanks to you ;-)@@Tarodev
@@randomragtags Glad I could help buddy. Good luck on your journeys!
these videos are so great.
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.
Just awesome!
More like this plz ! Thx
thanks for the info.
THANKS!
Super useful.
Wizard is back
🧙♂️
This is the best free software Ive seen. Respect.
great video
Great video
what an extraordinary explanation!
Thanks stranger
@@Tarodev 😨😭😭😭😭😭😭
Wow thanks your the best!
I love the tips!
Yeah you do 😉
@@Tarodev 😉
verry good and verry informativ
thanks!
Very helpful video! Thank you!
best as ever
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
ty
GOD!!!My broo
Nice but I want to see more on the new multiplayer services :)
Coming soon :D
Great vid, seams really helpful but dude... what happened to the quaternion vid? xD
Oh mate, any day now
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.
that is a great video
Glad you like it
Thanks!
Idk why, but this info is hard to find
Sounds like the perfect reason to make a video 😊
@@Tarodev definitely! Hope it does well
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