Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 soje402 · Mar 20, 2018 at 06:33 PM · physicsrigidbodymesh collider

I need non-convex colliders to work with non-kinematic rigidbody

Hello.

My goal is to have an object (eg a sphere) that can have a force applied to (therefore the rigidbody can't be kinematic). This sphere needs to contain a lot of little objects (like a lotto rolling sphere).

This is what i've done so far : i created the parent object (the sphere) with a semi-transparent material, non-kinematic rigidbody and a convex sphere collider. This object have a children, called "container". In blender, i have inverted the sphere normals so i have a non-convex sphere container. The container have a this new created sphere as a mesh collider. The engine forced me to add a kinematic rigidbody.

This way, i was able to instanciate objects in the container and they seem stay in it. In addition, i can move the parent sphere and it can roll on the ground, all the little objects have gravitation applied to.

The problem is that when the sphere move too fast, all theses objects passe through the container. I think the reason is that the container have no forces applied to, the position is just recalculated on the basis of the parent (the sphere). That could explain why changing collision detection mode have no effect.

There would also be the possibility to force, by a script, to force all the objects to stay in the radius of the sphere. Unfortunatly, in the future, the container object will not be a sphere so this workaround can not work.

Help would be greatly appreciated, thanks in advance.

Comment
Add comment · Show 3
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 hexagonius · Mar 20, 2018 at 07:51 PM 0
Share

I don't get this:

I think the reason is that the container have no forces applied to, the position is just recalculated on the basis of the parent (the sphere)

are you talking about 3 object types? container, sphere and your little objects?

avatar image soje402 hexagonius · Mar 20, 2018 at 09:10 PM 0
Share

sorry, i was talking about the container.

I think there are no forces calculated with the container, because it's what kinematic rigidbodies do.

It's like moving object in the editor, the new position is set without calculating collisions. But when, in the editor, you move objects slowly, it gives the impression that forces and collisions are calculated because there is no gap between two positions. I think it's what is happening here.

avatar image hexagonius · Mar 21, 2018 at 07:50 PM 0
Share

two things to consider: move the container in FixedUpdate. $$anonymous$$ove it with $$anonymous$$ovePosition.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FuzzyLogic · Mar 20, 2018 at 08:08 PM

What is happening is that your objects are moving so fast that the collision tests skip right past the wall of the sphere. Making the wall of the sphere thicker will help with the problem but you will still have the same issue at higher speeds.

.

What you want is to set the RigidBody Collision Detection mode to ContinuousDynamic for your sphere and the balls.

.

Discrete mode only tests the objects at the position where the object arrives at each frame, whereas ContinuousDynamic does what is called a 'sweep' test, testing all the positions between where the object was and where the object has moved to since the last frame.

.

Sweep testing (ContinuousDynamic) is much slower than Discrete so use it sparingly but it is much more accurate.

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 soje402 · Mar 20, 2018 at 09:12 PM 0
Share

The problem is that when the sphere move too fast, all theses objects passe through the container. I think the reason is that the container have no forces applied to, the position is just recalculated on the basis of the parent (the sphere). That could explain why changing collision detection mode have no effect.

I already tryed changing detection mode. See my comment http://answers.unity.com/comments/1482983/view.html I explained what I think is going on.

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.

Follow this Question

Answers Answers and Comments

151 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 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 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 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 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 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 avatar image

Related Questions

Compute mesh inertia tensor failed - NOT the usual problem 0 Answers

Why do I get OnTriggerExit upon collision when a rigidbody is kinematic? (example) 3 Answers

Is it necessary to attach a rigidbody/colliders to child objects? 1 Answer

Should rigidbodies be destroyed as they fall out of stage? 1 Answer

Player Pushes Enemies. (That's bad) -Still Unanswered- 1 Answer


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