How to Optimise Mesh Colliders [Unity Tutorial]
HTML-код
- Опубликовано: 5 фев 2025
- Mesh colliders are a funny thing... They're extremely useful for adding detailed collisions to complex meshes, but on the other hand they'll DESTROY the performance of your game if used incorrectly. Luckily, there's a solution to that!
Join me and learn your way through the Unity Game Engine, the C# language and the Visual Studio editor. Remember, if this video was useful then DROP A LIKE! 👍
Model: free3d.com/3d-...
💯 Want to help me out and allow me to keep making these tutorials? Consider supporting the channel on Patreon:
/ comp3interactive
😍 AWESOME high quality 3D game assets available here:
shop.runemarks...
🤩 SPONSORED LINKS:
www.gigatank30...
/ gigatank3000
💬 Join the Discord community here:
/ discord
📱 Find us on social media for more Tips and Tricks:
/ comp3interactive
/ comp3interactive
/ comp3int
📱 Play our games for FREE here on Google Play:
bit.ly/2TisAQo #UnityTutorial #Unity3D #Comp3interactive #GameDev
Very useful tip. Also Unity's ProBuilder can be used to create the fake mesh. Same fake mesh can also be set only to cast the shadows of the model, when the player is far away enough.
It surely can, personally I'm not a fan of Pro Builder, I just find it clunky to use but I'm used to using Blender and 3D modelling in general. All about what you're comfortable using I suppose
Excellent video, very well done, to the point, great explanation and rich content. Very clear voice and narration. Thank you very much and please keep it up!
My problem is using rigidbodies with mesh colliders. Because unity doesn't support non kinematic rb with non convex mesh collider
Same, I had to make the decision to change my workflow and simply setup the collision directly in Unity, using the primitive colliders.
It's a bit more time consuming than creating the collider meshes from your 3D application since its not as accurate to shape the colliders, but its functional and more optimised.
Thnx for this video! ive been trying to figure this out today, u explained it brilliantly! :)
Thank you so much for sharing us for very nice tricks to work with Mesh Colliders.
Hello, thank you for teaching this method, but I have a question about performance considerations. A box collider has 6 faces, so would a custom beveled box collider with 24 faces and a mesh collider without the convex option take 400% more calculation? Basically, are the number of faces on a mesh collider proportional to the performance cost, or can I at least plan it this way? I’m making a physics multiplayer VR game that needs accurate colliders, which is why I ask.
Hi Mike, Raph here. Another great tutorial, thank you!
it is good teqnique for quick open world for individual developer to make less time
I want use mesh collider and rigidbody (use gravity), but when i set rigidbody (use gravity) its should use convex at mesh collider. how i can use gravity without convex in mesh collider?
That's amazing! Great video!
how would you add a non-convex mesh collider to your object if it has a rigidbody component?
Thank you! Nice tutorial video
Thanks for the great video! I followed your instructions but for some reason it didn't quite work for me. I think my problem is that the Mesh Collider Components Cooking Options is still stucked on Everything where as yours changed automatically to Mixed (7:04). Any idea why or what's wrong?
Optimal collision meshes, regardless of the engine, must be convex (so no inset + extrude) and without holes.
This will still work for some purposes, but is more expensive and bug-prone.
It's better to make several convex collision meshes and import them all.
that is great, but isn't helpful because you may have to transform the shape to convex
I need to adjust the polygons in convex shape collider and didn't find anything about that topic
such a simple and awesome video, thanks for making this.
Great video! It's perfect! Thank you!
Wow thank you so much u such a boss
This was awesome thanks a lot for this tutorial
Thank you very much! Very informative video!
Thanks. Very helpful
Great video. Thanks!
Perfect video.
I know its been like 3 years but im trying to do a map
Great tip. I wonder if this method is still good for moving the tank for example through a city, because it is needed to collide with ground and other game objects
Yeh man this method would work perfectly. You might need to add a few more boxes for the tracks / any other dynamic parts just to get more detailed collision detection, but any way it would be 100x better than using a raw mesh collider
Very nice tutorial with amazing trick for improving performance of games.But i ran into a little problem whenever i add my collider mesh to the mesh collider component it rotates opposite, to the actual model.
I think you can fix it by going into Object>Apply>All Transforms, I haven't had my pc for almost 2 months so I don't really remember.
tHANKS
Great tutorial! What happens if your mesh animates and moves? Can you share how you would do that?
Great stuff, very informative! SUBBED
Very useful!
Wouldn't a way faster way be to just duplicate the mesh and use the limited dissolve tool? That way it gives you a slider to adjust how detailed you want it to be. It won't ever get down to primitive shapes like you made here, but it'd get pretty close and it'd be like x10 faster.
Well good idea for most casual cases, but when you need modular damage for your tanks or whatever - better to keep separated colliders on tower, tracks, hull etc.
Very good content.
I want to create a collision mesh for a shooting game character, but I wanted to know how to make the collider detect where in the body the shot was.
is 1000 tris ok for the mesh, cuz if you want to do a tank game you will need to add armour values and you can t just make a cube and a sphere.
Let me ask you something. To a character - and im talking about a hight poly char (my toon and works fine), a low poly version can work fine like a mesh collider, IF I ONLY use it in player OR some char in the scene, no? We hav this tech today, no?
a thousand thanks to you
Can you do this in unity without using blender?
Hello, I was making a racing game and needed help regarding this
Actually, I know there's the wheel collider component to go about it but I was planning to making my own vehicle physics
Now, the problem I am facing is regarding the wheels collision detection. The wheels are cylindrical in shape and so I couldn't apply a convex mesh collider to them. Adding a concave collider causes them to be kinematic, which they cannot be
Please help me out with this issue
Can I apply deformation on the 3D model using this optimized mesh collider way?
Writing on the tank means "scoundrel" in Russian 😊
Oh sweet! Atleast it wasn't offensive 😂 I never thought to check the translation!
Why would anyone want a tank that has no rigidbody for physics this is absurd
Raw Mesh Colliders - Highly likely won't affect the performance of static meshes.
I see nothing here that cant be done with primitives, you know you can attach primitves to bones? That way its nice and optimized and can move, and if you really need some extra precision with placement, use a child object and rotate it, that way you can have primitive colliders at off angles, not sure if off axis scaling works (probably not because its not a great idea anyways) and all of this when attached to a parent object with a rigidbody, its gonna act like one big rigidbody. Collisions included.
Not to mention these mesh colliders, unless broken into chunks, cannot move with animations like the graphical mesh can, itd be too expensive.
It has to check each triangle individually for collision, and has no concept of "inside" the mesh.
For example, a sphere collider is the simplest one, being only one 3d point in space, and then a radius in which you can collide, mesning if you somehow landed inside the mesh, it would pop you out the side youre closest too.
Same with a box collider, it checks collisions within a box volume, and because of that, the whole box counts as colliding.
But with mesh colliders (with maybe the exception of convex hulls, but i think theyre processed in exactly the same way, just as an easy optimization option)
The only time you collide with the object is when you touch anywhere one the outer hull, but thats it, if something was inside, it would then be stuck in there, with the mesh collider acting like an infinitely thin wall, only colliding when it touches the edge. Its okay for more insignificant objects that are just set dressing, and if you make all your important objects collision type "Continous"(where it drags the mesh along its trajectory instead of teleporting a certain distance, which is how instantanious works)
Are you Chapter Master Valrak's brother?
I just had to check who that was, but he does sound like he's from the area I live!
What happens when the turret rotates...?
If you're using moving components then you'll have more than one model, so you'd make more than one collider mesh box
To bad ur not explaning what are you pressing for people who first time uses Blender. Like Insert Mesh and the other stuff u click on.
Cool
If only you'd have as little as a program telling me what the fuck to click as a shortcut or explain in detail how to extrude something because I have no way of following the tutorial without knowing exactly what to click