• 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 trjp · Feb 15, 2012 at 09:05 PM · physicsbounce

Physics objects bouncing when bounce is 0!!

I created this project to illustrate a fairly sizeable problem with Unity Physics - that bounce cannot be eliminated from collisions...

http://dl.dropbox.com/u/1164739/WeirdPhysics.zip

I've zeroed Bounce - Multiplier is "Min" - I've played with Friction and Bounce Threshold - I've even tried an OnCollisionEnter Trigger to zero velocity and the boxes STILL BOUNCE!!

At this point I'm just assuming Unity's physics is junk - there are similar problems posted here but I'll leave this with the example in the hope that one day they might fix it??

If anyone has any ideas, please post em!

Comment
Add comment · Show 1
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 trjp · Feb 16, 2012 at 12:34 PM 0
Share

Note: I resolved the initial collision issue (ensuring objects were at least 1 unit in all 3 dimensions did this) so I've amended the question to just cover the bounce issue - which I'm fairly sure no-one will have a clue how to solve! :)

2 Replies

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

Answer by rabbitfang · Feb 17, 2012 at 02:17 AM

From a physics engine standpoint, what is probably happening is that the bouncing object penetrates the other object and is pushed back out. When it is pushed back out, a velocity or force is applied to give a more realistic physics simulation (even without bounce). (Normal force of the contacting surfaces).

One thing that you might try to do is to set the velocity of the bouncing object to zero in the direction of the collision normal so it isn't coming back at you.

Comment
Add comment · Show 4 · 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 trjp · Feb 17, 2012 at 02:36 AM 0
Share

I'd tried fiddling with the 'Penetration' values and I think you're right because some boxes bounce a LOT more than others (not necessarily related to their velocity either!) - but adjusting their velocity in the collision doesn't seem to work (I assume the 'shove' it gives is being done AFTER the collision triggers are firing?)

$$anonymous$$y other idea was to make them kinematic, 'shove' them downwards, and when I detect a collision, zero velocity and position them 'stacked' above the thing they hit (they can also disable physics on the thing they hit which reduces the amount of colliders which have to be dealt with) but it's proving 'harder than it sounds!!'

avatar image rabbitfang · Feb 17, 2012 at 03:47 AM 0
Share

I would guess that it is. $$anonymous$$odifying physics engine behavior like this is fairly annoying and it is likely that an update to the engine might cause your change to break. Which is why it is technically a 'hack'. You could try implementing Rigidbody yourself with modified behavior.

avatar image trjp · Feb 21, 2012 at 03:09 PM 0
Share

A bit more digging suggests the problem isn't penetration - it's something to do with transmitted forces...

If a block hits another block - both of which have no bounce - they won't bounce. However, if a block hits another block which is touching another block (and so on) it seems forces are transferred through all of those objects - and even if they are all 'bounce zero' - they bounce.

Simple 2-body collisions seem to be O$$anonymous$$ but the moment you have a collection of objects, things start to go awry...

avatar image Deepscorn trjp · Jun 16, 2020 at 04:41 PM 0
Share

$$anonymous$$aybe setting rigidBody.maxDepenetrationVelocity = 1 will help. See https://answers.unity.com/questions/58689/bounciness-0-still-bouncing.html?childToView=1742680#comment-1742680

avatar image
5

Answer by uanmanarmy · Jul 31, 2014 at 10:31 AM

Put this code onto your objects #pragma strict

 function FixedUpdate()
     {
         var currentVelocity = rigidbody.velocity;
  
         if (currentVelocity.y <= 0f) 
             return;
          
         currentVelocity.y = 0f;
          
         rigidbody.velocity = currentVelocity;
     }
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 cryptex. · Feb 23, 2016 at 10:56 AM 0
Share

Thank you so much. It worked for me.

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

When an object bounces between two bouncy objects it goes through them 1 Answer

Bouncing not working 1 Answer

how to make trampoline in unity 3D 1 Answer

character bounces when landing on a box 0 Answers

Ball bounce problem 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