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

大憨熊 提交于 2020-04-16 02:04:33

问题


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

回答1:


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):

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.



来源:https://stackoverflow.com/questions/54656220/physics-object-doesnt-bounce-correctly-at-low-speed-in-unity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!