using UnityEngine; public class GetComponentExample : MonoBehaviour { void Start() { HingeJoint hinge = gameObject.GetComponent(typeof(HingeJoint)) as HingeJoint; if (hinge != null) hinge.useSpring = false; } }