圆柱形

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处。

CylindricalConstraint 允许其附着体沿一个轴滑动并围绕另一个轴旋转。该约束与 SpringConstraint 一起,非常适合构建车辆悬架,其中车轮的减震器可以上下滑动,而车轮本身旋转。该约束还可以以角度和线性的方式获得动力。

角动能

如果圆柱的 AngularActuatorType 设置为 Motor,它将尝试旋转附着体,目标是达到其 AngularVelocity。您可以进一步通过 MotorMaxAngularAcceleration 和 MotorMaxTorque 控制这种旋转。

如果圆柱的 AngularActuatorType 设置为 Servo,它将尝试旋转到 TargetAngle 所指定的角度。该旋转由 AngularSpeed、AngularResponsiveness 和 ServoMaxTorque 控制。

线动能

如果圆柱的 ActuatorType 设置为 Motor,它将尝试翻译附着体,目标是达到 Velocity。您可以进一步通过 MotorMaxAcceleration 和 MotorMaxForce 控制这种翻译。

如果圆柱的 ActuatorType 设置为 Servo,它将尝试将附着体翻译到由 TargetPosition 指定的设定分隔。此翻译由 Speed、LinearResponsiveness 和 ServoMaxForce 控制。

限制

您可以设置限制以限制滑动范围和旋转的圆柱约束。

启用 LimitsEnabled 属性将暴露 LowerLimit 和 UpperLimit 值,以及 Restitution,它定义了当附着体达到任一限制时的弹性。

启用 AngularLimitsEnabled 属性将暴露 LowerAngle 和 UpperAngle 限制,以及 AngularRestitution,它定义了当附着体达到任一限制时的弹性。

LimitsEnabled = true
AngularLimitsEnabled = true

倾斜角

InclinationAngle 定义了旋转轴的方向,作为从 Attachment0 的 X 轴在 X/Y 平面中的一个角度,范围从 -180 到 180。这使您可以在不改变滑动轴的情况下倾斜旋转元件。

InclinationAngle = 90
InclinationAngle = 30
©2026 Roblox Corporation、Roblox、Roblox 标志及 Powering Imagination 是我们在美国及其他国家或地区的注册与未注册商标。