关节限制将由 铰链关节 用于限制关节角度。
其他资源:铰链关节。
using UnityEngine;
public class Example : MonoBehaviour { void Start() { // Set the hinge limits for a door. HingeJoint hinge = GetComponent<HingeJoint>();
JointLimits limits = hinge.limits; limits.min = 0; limits.max = 90; limits.bounciness = 0; limits.bounceMinVelocity = 0; hinge.limits = limits; } }