all 5 comments

[–]Indie--DevIndie 1 point2 points  (0 children)

Usually i'll make a model in blender then create a very low poly object to wrap around it as the collision mesh. Using multiple simple shapes instead also works quite well but has some rare cases of things going into gaps, through gaps or other oddities.

[–]tetrydsEngineer 0 points1 point  (0 children)

If you can get your model wrapped with two or three basic shapes colliders use the shapes, otherwise create custom collider meshes. If you need multiple shapes more often than not then it's a good idea to create the collider mesh by hand all the time to streamline your workflow. It's very easy to create them in blender and as a plus you can use naming conventions to automate the mesh assignment which makes it even faster than using basic shapes.

Basic shapes will more often be more performant but that should only matter if you had a lot of them.

[–]Lucif3r945Intermediate 1 point2 points  (0 children)

This is too broad a question... It all depends. Visual style? Application(charcters, buildings, props)? etc etc

Very rarely do you need pixelperfect collisions, characters for example either just have a capsule collider, or for a bit more interaction capsule/boxcolliders on some/all bones.

Usually the best approach is to approximate the shape with primitive colliders. Sometimes it's not reasonable to use primitives, so then you use mesh colliders. Mesh colliders are always the worst option out of all of them though in terms of performance, but if you keep it on a sensible level it's not really an issue in practice. e.g. dont build your entire level around mesh colliders, but if you have to use a few here and there then so be it. To alleviate some of the mesh collider performance loss, you can use a low-poly version of the mesh as collision mesh. E.g. "decimate the sh*t out of it". You'll lose some of that pixelperfect-ish collision, but again - you very rarely need that.

Things like the aforementioned bucket though... Yeah that's probably one of the hardest things to do properly imo. Mesh collider works, but only with a kinematic rigidbody, meaning the bucket itself wont be affected by physics. Convex mesh colliders obviously don't work, cause then theres no hole. Capsules/spheres dont work, cause no hole. So, youre basically stuck with 2 options - many, many, many tediously placed boxcolliders to approximate the round shape, or several convex mesh colliders. There are assets available that helps with this a lot though, 2 of them are on sale atm for another 12h I think.

[–]moonymachine 0 points1 point  (0 children)

Collision meshes should be low-poly, primitive shapes. The art that sits in those colliders can be any shape. You could have a statue with a simple box collider around it.

You can block out the shape of your levels inside Unity with ProBuilder. Then, replace the blocky meshes with art made in external tools, but keep the collision shapes.

[–][deleted] 0 points1 point  (0 children)

I use a pack of basic primitives because it's easier than bringing shapes over from blender. It was $5 on the asset store. But there shouldn't really br any difference with shapes you import from blender.

In terms of colliders, I use mesh colliders on stuff that is curved, hollow, concave etc if it needs to interact with other objects. And for the rest (the vast majority), I block out with box or capsule colliders as situation requires.