固定关节 (Fixed Joint) 将对象的移动限制为依赖于另一个对象。这有点类似于__管控 (Parenting),但是实现的方式是通过物理系统而不是__变换 (Transform) 层级视图。使用固定关节的最佳场合是在希望对象可以轻松相互分离时,或者在没有管控情况下连接两个对象的移动。
属性: | 功能: |
---|---|
Connected Body | 对关节所依赖的刚体的引用(可选)。如果未设置,则关节连接到世界。 |
Break Force | 为破坏此关节而需要施加的力。 |
Break Torque | 为破坏此关节而需要施加的扭矩。 |
Enable Collision | 选中此复选框后,允许关节连接的连接体之间发生碰撞。 |
Enable Preprocessing | 禁用预处理有助于稳定无法满足的配置。 |
在游戏中有时可能希望对象永久或暂时粘在一起。固定关节可能是比较适合用于这些情况的__组件__,因为不必通过脚本更改对象的层级视图来实现所需的效果。代价是所有使用固定关节的对象都必须使用__刚体__。
例如,如果要使用“粘性手榴弹”,可写一个脚本来检测与另一刚体(如敌人)的碰撞,然后创建一个固定关节并附加到该刚体。然后,当敌人四处移动时,关节将使手榴弹紧贴在他们身上。
可使用 Break Force 和 Break Torque 属性来设置关节强度的限制。如果这些值小于无穷大,并对该对象施加大于这些限制的力/扭矩,则其固定关节将被破坏并将摆脱其约束的束缚。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.