此关节允许由刚体物理组件控制的游戏对象沿着空间中的一条线滑动(例如滑门)。对象可以沿着线自由移动以响应碰撞或作用力,或者对象也可以通过电动力移动,并施加限制以使其位置保持在线的某个部分之内。
属性: | 功能: |
---|---|
Enable Collision | 连接的两个对象能否相互碰撞?选中此复选框表示“能”。 |
Connected Rigid Body | 在此处指定该关节连接到的另一个对象。如果将此属性保留为 None__,此关节的另一端将固定到空间中由 Connected Anchor__ 设置所定义的点。选择字段右侧的圆圈可查看要连接到的对象的列表。 |
Auto Configure Connected Anchor | 选中此框可为该关节连接到的另一个对象自动设置锚点位置。(选中此框将无需填写 Connected Anchor 字段。) |
Anchor | The place (in terms of X, Y co-ordinates on the RigidBody) where the end point of the joint connects to this object. |
Connected Anchor | The place (in terms of X, Y co-ordinates on the RigidBody) where the end point of the joint connects to the other object. |
Auto Configure Angle | Check this box to automtically detect the angle between the two objects and set it as the angle that the joint keeps between the two objects. (By selecting this, you don’t need to manually specify the angle.) |
Angle | Enter the the angle that the joint keeps between the two objects. |
Use Motor | Use the sliding motor? Check the box for yes. |
Motor | |
Motor Speed | Target motor speed (m/sec). |
Maximum Motor Force | The maximum force the motor can apply while attempting to reach the target speed. |
Use Limits | Should there be limits to the linear (straight line) force? Check the box for yes. |
Translation Limits | |
Lower Translation | The minimum distance the object can be from the connected anchor point. |
Upper Translation | The maximum distance the object can be from the connected anchor point. |
Break Force | Specify the linear (straight line) force level needed to break and so delete the joint. Infinity means it is unbreakable. |
Break Torque | Specify the torque (rotation) level needed to break and so delete the joint. Infinity means it is unbreakable. |
(另请参阅 2D 关节中的详情和提示以了解所有 2D 关节的有用背景信息。)
使用此关节使对象滑动!此关节的目的是在可延伸到无穷远的一条可配置线上保持两点的位置。这两个点可以是两个 2D 刚体__组件,或一个 2D 刚体__组件和世界中的一个固定位置。(将 Connected Rigidbody 设置为 None,即可连接到世界中的固定位置)。
此关节对两个连接刚体对象施加线性力,使这些对象保持在这条线上。此关节还有一个模拟的线性电机可施加线性力,从而沿着这条线移动刚体对象。电机可以关闭或开启。虽然这条线无限长,但可以使用 Translation Limits 选项来仅指定要使用的一段线。
此关节同时有三个约束。所有约束均为可选约束:
例如:
使用此关节构建的物理对象就好像是这些对象在一条线上连接在一起一样。例如:
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.