本文介绍了物理对象在Unity中无法以低速正确反弹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,当启用物理的球缓慢移动时,它无法正确地弹开物体.我拍了一段视频来说明问题

https://youtu.be/9T1hkir7sCo

基本上,球应该碰到静止的球,静止的球应该弹起.当速度足够快但在阈值以下时,它们都开始一起移动,这看起来很奇怪,这可以起作用.

这是怎么回事,如何使它正确反应?

实验细节(两个对象都相同):

RigidBody

  • 质量:1
  • 拖动:0
  • 角向阻力:0
  • 使用重力:false

物理材料:

  • 动摩擦:0
  • 静摩擦:0
  • 弹跳:1

解决方案

Unity的默认设置 Bounce Threshold 用于识别跳动的是速度> 2


您可以在PhysicsManager(-> -> )中更改此Bounce Threshold:

或在运行时通过脚本(请参见 Physics.bounceThreshold )

Physics.bounceThreshold = 1;


根据需要将其缩小...但是请注意

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

解决方案

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


You can change this Bounce Threshold in the PhysicsManager (->->):

or via script on runtime (see Physics.bounceThreshold)

Physics.bounceThreshold = 1;


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

这篇关于物理对象在Unity中无法以低速正确反弹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 18:46