Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SpringJoint

The spring joint ties together 2 rigid bodies, spring forces will be automatically applied to keep the object at the given distance.
Read time 7 minutesLast updated 2 days ago

Definition

  • Type: Class
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
  • Inherits from: Joint
[RequireComponent(typeof(Rigidbody))]public class SpringJoint : Joint

Remarks

The Spring attempts to maintain the distance it has when it starts out. So if your joint's start at a rest position where the two rigidbodies are far apart, then the joint will attempt to maintain that distance. The minDistance and maxDistance properties add on top of this implicit distance.

Properties

Property

Description

damperThe damper force used to dampen the spring force.
maxDistanceThe maximum distance between the bodies relative to their initial distance.
minDistanceThe minimum distance between the bodies relative to their initial distance.
springThe spring force used to keep the two objects together.
toleranceThe maximum allowed error between the current spring length and the length defined by _minDistance and _maxDistance.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.