2D 距离关节__是一种 2D 关节,它连接由 2D 刚体__物理组件控制的两个游戏对象,使这两个对象保持一定距离。
属性: | 功能: | ||
---|---|---|---|
Enable Collision | 选中此框可允许两个连接的游戏对象之间发生碰撞。 | ||
Connected Rigid Body | 使用此字段来指定该 2D 距离关节连接到的另一个游戏对象。如果将此字段保留为 None (Rigidbody 2D),2D 距离关节的另一端将固定到空间中由 Connected Anchor 设置所定义的点。选择字段右侧的圆圈可查看要连接到的游戏对象的列表。 | ||
Auto Configure Connected Anchor | 选中此框可为该 2D 距离关节连接到的另一个游戏对象自动设置锚点位置。如果启用此选项,则无需填写 Connected Anchor 字段。 | ||
Anchor | 定义 2D 距离关节的端点连接到此游戏对象的位置(以 2D 刚体__上的 x、y 坐标表示)。 | |Connected Anchor__ | 定义 2D 距离关节的端点连接到另一游戏对象的位置(以 2D 刚体__上的 x、y 坐标表示)。 | |Auto Configure Distance__ | 选中此框可自动检测两个游戏对象之间的当前距离,并将该距离设置为 2D 距离关节在两个游戏对象之间保持的距离。如果启用此选项,则无需填写 Distance 字段。 |
Distance | 指定 2D 距离关节在两个游戏对象之间保持的距离。 | ||
Max Distance Only | 如果启用此选项,则 2D 距离关节仅强制执行最大距离,因此连接的游戏对象仍然可以彼此靠近,但不能超出 Distance 字段定义的距离。如果未启用,则游戏对象之间的距离为固定距离。 | ||
Break Force | 指定破坏并进而删除 2D 距离关节所需的作用力水平。Infinity 表示关节牢不可破。 |
此 2D 关节的目的是保持两点之间的距离。这两个点可以是两个 2D 刚体组件,或一个 2D 刚体组件和世界中的一个固定位置。 要将 2D 刚体__组件连接到世界中的固定位置,请将 Connected Rigidbody__ 字段设置为 None。
此 2D 关节不施加扭矩和旋转。但会对两个连接点施加线性力,使用非常刚性的模拟弹簧来保持距离。该弹簧不可配置。
此 2D 关节具有可选的约束:
使用此 2D 关节构建的物理对象就好像是通过可旋转的刚性连接方式相连一样。
请参阅 2D 关节中的详情和提示以了解所有 2D 关节的有用背景信息。
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.