• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ibyte · Nov 21, 2009 at 07:35 AM · gameobjectphysicscollider

Collider size question

  1. Create a new project
  2. Create Other GameObject -> "Cube"
  3. Create Other GameObject -> "Plane"
  4. Move Plane to -1 in Y direction
  5. Replace the box collider on the Cube with a Mesh collider
  6. Change both colliders to convex
  7. The Cube collider matches the shape of the cube
  8. The Plane collider is orders of magnitude thicker then the plane.

Can anyone tell me why?

The collider size also does not seem to be affected by the Y scale.

EDIT Note: I haven't accepted one of the answers below as I was referring to two meshes both with convex set. It seems it's not possible to over ride the size of a mesh collider on built in objects.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Ashkan_gc · Nov 21, 2009 at 08:25 AM

because a collider should have a value greater than zero in all directions. a plane is a plane of vertices with normals and even is not visible from the opposite side but colliders are shapes and their calculation has nothing to do with the mesh. as you understand the plane has no thickness because it's just a series of vertices with their normal in same direction. there is not a real world shape for them in 3D and you can not find anything with only one side available in real world so their collider shape should be a verry thin box like shape.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ibyte · Nov 21, 2009 at 07:41 PM 0
Share

Hi Thanks for the explanation and I agree a very "thin" box like shape would be fine but the collider added is very thick. If you do the test you will see what I mean. IF it could be scaled in the "y" direction that wold help a lot.

avatar image
1

Answer by $$anonymous$$ · Nov 21, 2009 at 10:21 PM

When you add a collider component to an object with a mesh, the collider auto-sizes to fit the mesh, but that's just a convenience. You can adjust the size of the collider manually in the inspector, in the collider's "size" property - see the Box Collider section of the Unity manual (in the Reference section).

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ibyte · Nov 22, 2009 at 02:24 PM 0
Share

$$anonymous$$esh collider's don't have this property.

avatar image
0

Answer by ibyte · Nov 21, 2009 at 09:26 PM

A possible "work around" to my question is to create and resize a cube to match the size of the plane. Of course this add's more vertices/faces but at least the collider will match the shape of the cube even if I make it extremely thin.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ashkan_gc · Nov 22, 2009 at 02:33 AM 0
Share

you can easily change properties of a collider like it's size and center and ... you can use a plane and use any type of collider you want with customized properties and size. you can even use a sphere collider and there is no limitation. the created collider is just for making the process easy.

avatar image ibyte · Nov 22, 2009 at 02:25 PM 0
Share

$$anonymous$$esh collider's don't have size and center properties.

I noted this from the Unity help "The $$anonymous$$esh Collider builds its collision representation from the $$anonymous$$esh attached to the GameObject, and reads the properties of the attached Transform to set its position and scale correctly."

So it would seem since it can't be zero the next increment of one full Unity unit which for my purposes is way too big.

avatar image
0

Answer by Novodantis 1 · Dec 03, 2009 at 02:22 PM

Replace the Mesh Collider on the Plane with a Box Collider. It will fit your plane, and you can adjust the Y thickness (I tested 0.001, which still stopped a falling rigidbody).

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Statement · Dec 04, 2009 at 09:23 AM 0
Share

But tunneling still occur easily if the object falling is thin or is moving fast. (Worst case being thin and fast).

avatar image Novodantis 1 · Dec 04, 2009 at 10:29 AM 0
Share

That is a general issue with using such a narrow object for collision. If it was essential, you could always decrease the time interval of checking the physics engine (Edit > Project Settings > Time > Fixed Timestep).

If it was a platform, you could offset the collider downward so that the top matches the surface, but it has seveal units of thickness below.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Translate.transform problems (collision/Rigibody) 0 Answers

Detecting other Objects when placing Object 1 Answer

Melee-like function? 1 Answer

Get All Renderers inside of GameObejct 0 Answers

Why do Instantiated GameObjects Colliders only work on player i am controlling,nothing else? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges