Legacy Documentation: Version 5.2
Hinge Joint 2D
Wheel Joint 2D

Slider Joint 2D

Switch to Scripting

The Slider Joint 2D component allows a Sprite object controlled by rigidbody physics to slide along a line in space. The object can optionally be left free to move anywhere along the line in response to collisions or forces. It can also be moved along by a motor force and have limits applied to keep its position within a certain section of the line.

Property: Function:
Collide Connected Can the two connected objects collide with each other?
Connected Rigidbody The other Rigidbody2D object that the one with the joint is connected to. If this is null then the othen end of the joint will be fixed at a point in space.
Anchor Coordinate in local space where the end point of the joint is attached.
Connected Anchor Coordinate in the other object’s local space where its end of the joint is attached.
Angle The angle of the line relative to the other rigidbody (or world space).
Use Motor Should the sliding motor be enabled?
Motor Speed Target motor speed (units/sec).
Maximum Motor Force The maximum force the motor can apply while attempting to reach the target speed.
Use Limits Should the angle be limited?
Lower Translation The minimum distance the rigidbody object can be from the connected anchor point.
Upper Translation The maximum distance the rigidbody object can be from the connected anchor point.

Details

The Slider Joint can be used for sliding objects such as doors but also for any objects that follow a simple, straight path. Such objects might include simple characters, obstacles that rise or fall from their surroundings, projectiles and many other common game elements.

Hinge Joint 2D
Wheel Joint 2D
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961