• 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
0
Question by RLin · Aug 01, 2015 at 09:24 PM · rigidbodycolliderlagmeshcollider

Does collider size affect performance?

Situation 1:

There are two box colliders, both static. One is of size 1 x 1 x 1 and the other is 10000 x 10000 x 10000 in size. Will the large one cause lag?

Situation 2:

Same setup, but they now both have now have a non-Kinematic rigidbody with mass one. Will the larger one lag?

Situations 3 & 4:

Same as situation one, but using mesh colliders. One is scaled to 10000x its normal size. Will the larger one lag?

Comment
Add comment · Show 2
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 Hexer · Aug 01, 2015 at 09:47 PM 0
Share

No it won't.

What does affect performance are, light and the polycount of a mesh.

avatar image Positive7 · Aug 01, 2015 at 09:55 PM 1
Share

Instantiating a mesh collider with custom scale at runtime might be slow.(Afaik) So try too avoid that.

1 Reply

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

Answer by zach-r-d · Aug 01, 2015 at 09:58 PM

It's hard to say if any of those situations individually would cause lag to appear where previously there was none. As for whether it will affect performance, the answer ultimately depends on the underlying implementation of the physics engine. More specifically, it depends on the spatial acceleration strategy/data structure being used. With no spatial acceleration (i.e. n-squared collision detection, where every object checks every other object for collision), it wouldn't matter, but Unity/PhysX certainly does something smarter. But regardless of the exact spatial partitioning strategy used (whether it's an octtree, kd-tree, or otherwise), the fact is that the larger a collider is, the more things there will be that need to check if they are colliding with it. So in that respect, yes, collider size will affect performance. Making the collider use a rigidbody (making it dynamic) will be an additional hit, as will making it a mesh collider.

Comment
Add comment · 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

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Workaround to Non-Convex mesh colliders with non-Kinematic RigidBodies? 1 Answer

fast collision between a mesh collider and a continuous dynamic rigidbody 1 Answer

How to remove internal triangle/faces when combining mesh 0 Answers

Is there ANY possible way to use a mesh collider(without convex) with a rigidbody? 1 Answer

Why doesn't my mesh collider collide while a capsule or cube collider works fine? 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges