Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Physics object doesn't bounce correctly at low speed in Unity

I am running into a problem where when a physics enabled ball is going slowly it doesn't bounce off objects correctly. I have made a video to illustrate the problem

https://youtu.be/9T1hkir7sCo

Basically, the ball should run into the stationary ball and the stationary one should bounce off. This works when the speed is fast enough, but below a threshold they both just start moving together, which looks weird.

Whats going with this, and how can I make it react properly?

Experiment details (same for both objects):

RigidBody

  • Mass: 1
  • Drag: 0
  • Angular Drag: 0
  • Use gravity: false

Physics material:

  • Dynamic friction: 0
  • Static friction: 0
  • Bounciness: 1
like image 218
Mr Bell Avatar asked Feb 12 '19 18:02

Mr Bell


People also ask

How do I stop Rigidbody from bouncing unity?

Try using physics materials. Set bounciness to 0 on the object that the player will jump on.


1 Answers

Unity's default Bounce Threshold for recognizing bounces is a velocity > 2

Set a velocity value. If two colliding objects have a relative velocity below this value, they do not bounce off each other. This value also reduces jitter, so it is not recommended to set it to a very low value.


You can change this Bounce Threshold in the PhysicsManager (Edit->Project Settings->Physics):

enter image description here

or via script on runtime (see Physics.bounceThreshold)

Physics.bounceThreshold = 1;

Make it as small as you need it ... but note

This value also reduces jitter, so it is not recommended to set it to a very low value.

enter image description here

like image 177
derHugo Avatar answered Sep 22 '22 15:09

derHugo