• 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
2
Question by amirabiri · Oct 13, 2011 at 08:59 PM · physics

Physics pushback causing too much velocity

I have a problem with the physics simulation. I have a physics object (rigidbody + collider) that when its destroyed, I want to spawn other physics objects in its place (wreckage of the explosion). For every object destroyed there are 2-4 spawned. The starting position of the spawned objects is naturally that of the destroyed one, with some randomization of location around the last position of the original object.

My problem is that when the objects spawned overlap with each other, the physics engine gives them a huge stating velocity. I am assuming that this is the result of the push back (pushing the objects back so they don't overlap), which somehow Unity's physics engine translates to mean that the objects collided really hard.

I can't just solve the problem with a simple radius because the objects have unique shapes and random starting rotations. So if I push them far enough away from the center to prevent the huge velocity boost, the visual effect is unnatural - they appear to have spawned not as wreckage of the original object but "appear" around where the original object was. Playing around with different radiouses doesn't give a satisfactory result, it's just more or less velocity boost vs. more or less unnatural visual effect.

My question is if there is a way to get unity to separate the objects without giving them a huge boost as a result? Or alternatively is there a not expensive but more accurate way to calculate how far back to push them? (I've tried using the mesh bounds but that's too crude and didn't solve the problem). Obviously I want to avoid doing the work of the physics engine but if there is no other choice I can. Or perhaps another approach which I've missed?


Edit: After a bit of experimenting I realized that the problem only occurs when more than two rigidbody-colliders overlap. More specifically when two rigidbody-colliders are pushed back from each other, they don't get any velocity out of that. However if in the process they hit (or overlap) a third rigidbody-collider, that is interpreted by the physics engine as a normal collision due to movement and therefore generates impact force.

That makes sense (although it would still be nice to be able to control it easily) and suggests some possible solutions. For example I can try and cancel collisions between the parts excluding selected pairs and then do something along several frames or something along these lines.

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

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

2D 360 degress platformer example needed 0 Answers

Trouble Understanding Vector3.Angle() Result 2 Answers

ignore forces except gravity? 1 Answer

How to make a system that will let elements interact with other elements? 1 Answer

Accessing a parent's other children 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