- Home /
How to make a box collider fit into a custom model?
I just recently made a model in Blender (Still have a problem there, have to export at a scale of 40). The model is terrible looking coffee cup, and when I insert a box collider, it is a big box. Is there a way to make it so the Box Collider fits exactly with the model? If so, please tell me how in detail, new to Unity + GameDev + Coding... Thanks in advance!
Unless you have a reason to want all geometry to collide, do not use a mesh collider
The mesh collider worked perfectly, thank you. Not sure what you're saying SirGive, I am new to Unity/GameDev/Coding lol. I used the mesh collider and it worked the way I needed. A box collider just throws a box around it, and I have a CoffeeCup object, that i made in Blender, and I want to only collide with the cup, not the area around it, I don't know how to do anything in Unity really, I just accidently made a game so if you bump into something you start flying away, made a maze out of it xD
Actually, after a bit more testing, it isn't PERFECT, the collider from the mug to the handle, isn't on the object, it just makes a line from one point to the other (Confusing) Is there a program or a way to edit a Collider to fit EXACT on the object?
Do you want accurate collision with the cup? IE: its the actual environment? Or is it really just an object that can be walked into, knocked over, or picked up? Generally you treat objects like these as boxes because its not very taxing to calculate collisions for it. If you have this detail collision for just a $$anonymous$$cup that is really not important in the grand scheme of things - it wastes tons of calculations making sure collision with it is exact
This is not my actual game that I'm going to sell, it is me trying to understand unity better. Right now I want to make it so it is a big cup that the player can hit, but I want the Collider to fit perfectly around the edges up the cup. I don't want the player to stop moving (In my case, start flying around) by touching a non-existant box around the cup. I want him to stop moving (In my case, start flying around) when touching the actual cup. If my statements are confusing, I do appologize, I am new to game development and Limitations, and also not very good at explaining things.
Answer by frarees · Nov 16, 2014 at 04:30 AM
You can adjust collider size manually from BoxCollider's inspector. If you want to automate this, you can use Renderer.bounds to adjust your Collider.bounds.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Rotation Issue 1 Answer
Can unity handle this city (it's multiple meshes)? 1 Answer
Modeling Tutorial 1 Answer
Importing Blender model with multiple empty material indices 1 Answer