- Home /
Why does my character walk through all objects?
Hi guys,
I am new to unity so this may be a stupid question, but why does my 3rd person character walk through all objects? When i for example import a wooden box from 3ds max, my character just walks through it. Does anyone know how to solve this problem?
Thanks in advance! :)
Answer by adrenak · Feb 21, 2012 at 09:44 AM
i think that the object that you import doesn't have Collider. while importing you can see in the inspector something called generateColliders check its checkbox. If you want to have Collider on an object that you already imported, then click on the model in the project window and select generatedColliders.
I Hope this helped!
I would just like to add a bit more information to this:
Ticking the generateColliders box will generate a $$anonymous$$esh Collider, which is not good for performance.
A better option may be to select the wooden box object in your scene or heirachy, click the component menu, mouse-over Physics, select Box Collider.
You will then see the Box Collider in your inspector, this allows you to resize and re-poisition the Collider so that it fits your Box perfectly. Unity does try to automatically correctly size colliders for you though.
This applies to objects where a Box Collider doesn't seem to be the best option, for example when importing a standard dining chair I would create 3 box colliders (Seat, legs, back), rather than a mesh collider.
Answer by angelonit · Nov 19, 2013 at 11:18 AM
Yeah, since not all colliders actually colide amongst eachother, you usually want to assign box and sphere colliders to your character's parts and limbs, a mesh collider to the environment object(like a 3d max imported file or a terrain) the rest of the objects can also be combinations of sphere and box colliders, or maybe convex mesh colliders but I haven't tested that. http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html
Your answer
Follow this Question
Related Questions
Detonation of an object on collision of character.... 1 Answer
2D character arms that aren't a separate object look at mouse. 1 Answer
Need Help! My Score Text won't updated until the last object collected 2 Answers
how to raycast instantiated game characters 1 Answer
i want to insert name on character 3 Answers