• 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 mathmos_ · Oct 17, 2012 at 09:19 PM · physicsrigidbodycolliderbox collider

Compound colliders are acting strangely

So I'm trying to make a system for destructible objects and for this to for I need to "shatter" the object at "glue" it together again and I'm currently testing different ways of gluing. I tried making a wall out of cubes where each cube would have a box collider and they would be parented to an object that would have a rigid body, essentially forming a compound collider. I tried interacting with it and I noticed that it behaved strangely. When I tipped it over it fell unnaturally slowly. I then tried making a similar wall with a single box, single collider and rigid body with the same configuration and it behaved totally different.

Does anyone have a solution for this where I can keep using the compound collider and still correct physics behavior?

Comment
Add comment · Show 8
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 Owen-Reynolds · Oct 17, 2012 at 11:00 PM 0
Share

Are you building it through code? That sometimes breaks physics, often making it look feathery. You just have to add a line to "kick" it.

avatar image mathmos_ · Oct 18, 2012 at 09:31 AM 0
Share

Yes I am. How do I kick it? Do I add a bit force? If so how much?

avatar image mathmos_ · Oct 23, 2012 at 01:17 PM 0
Share

So I did an experiment where I set up a three cubes with a box collider each under a single transform with a rigidbody (compound collider) and a single cube scaled to have the same shape with a single collider and a rigidbody (normal box collider), and the same problem appears to be present in this experiment. So it is not caused by scripting.

avatar image Owen-Reynolds · Oct 24, 2012 at 03:41 AM 0
Share

Couldn't duplicate that. 4 Unity cubes w/box collider. Child to empty with rigidbody. Tried two ways, adding the RB to the parent before/after childing the cubes. Either way it seemed to fall/bounce just fine.

avatar image mathmos_ · Oct 24, 2012 at 10:55 AM 0
Share

The difference is subtle. It appears to me that the compound collider seems lighter and is more likely to slide, but I'm not entirely sure. $$anonymous$$y concern is that this slight difference is what is causing the problem when working with many compound colliders consisting of many primitive colliders.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Owen-Reynolds · Oct 19, 2012 at 04:38 AM

Doing anything complex to a rigidbody in code can screw up the settings. It often looks like it's moving in water.. Turning on/off isKinematic won't break it. Things like changing the scale, or reparenting can cause the glitch.

There really are other threads on this, but I couldn't find the search terms to get them (rigidbody unity broken floating didn't work.) But, you have to "kick" it afterwards by setting it Inactive then Active again (I think.) Or maybe flipping isKin off/on (the scripts where I've done it are buried in a big project.) One of those things tricks Unity into recalcing the correct values.

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 mathmos_ · Oct 23, 2012 at 11:43 AM 0
Share

That sound like the exact problem I'm dealing with. I've tried flipping inactive/active, iskinematic and use gravity without success. Any other ideas on how to kick it?

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

10 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

Related Questions

Player keeps bouncing off the walls 2 Answers

Velocity data from OnCollisionEnter is delayed (incorrect) 2 Answers

Vertical push doesn't let the object fall down instantly 1 Answer

Getting a sword in place while attacking an enemy 3 Answers

My object falls through terrain. 8 Answers

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