Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

CharacterJoint

Namespace: UnityEngine

/

Inherits from: Joint

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

Character Joints are mainly used for Ragdoll effects. They are an extended ball-socket joint which allows you to limit the joint on each axis.

Variables

enableProjectionBrings violated constraints back into alignment even when the solver fails. Projection is not a physical process and does not preserve momentum or respect collision geometry. It is best avoided if practical, but can be useful in improving simulation quality where joint separation results in unacceptable artifacts.
highTwistLimitThe upper limit around the primary axis of the character joint.
lowTwistLimitThe lower limit around the primary axis of the character joint.
projectionAngleSet the angular tolerance threshold for projection.If the joint deviates by more than this angle around its locked angular degrees of freedom, the solver will move the bodies to close the angle.Setting a very small tolerance may result in simulation jitter or other artifacts.Sometimes it is not possible to project (for example when the joints form a cycle).
projectionDistanceSet the linear tolerance threshold for projection.If the joint separates by more than this distance along its locked degrees of freedom, the solver will move the bodies to close the distance.Setting a very small tolerance may result in simulation jitter or other artifacts.Sometimes it is not possible to project (for example when the joints form a cycle).
swing1LimitThe limit around the primary axis of the character joint.
swing2LimitThe limit around the primary axis of the character joint.
swingAxisThe secondary axis around which the joint can rotate.
swingLimitSpringThe configuration of the spring attached to the swing limits of the joint.
twistLimitSpringThe configuration of the spring attached to the twist limits of the joint.

Inherited members

Variables

gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagThe tag of this game object.
transformThe Transform attached to this GameObject (null if there is none attached).
anchorThe Position of the anchor around which the joints motion is constrained.
autoConfigureConnectedAnchorShould the connectedAnchor be calculated automatically?
axisThe Direction of the axis around which the body is constrained.
breakForceThe force that needs to be applied for this joint to break.
breakTorqueThe torque that needs to be applied for this joint to break.
connectedAnchorPosition of the anchor relative to the connected Rigidbody.
connectedBodyA reference to another rigidbody this joint connects to.
enableCollisionEnable collision between bodies connected with the joint.
enablePreprocessingToggle preprocessing for this joint.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

BroadcastMessageCalls the method named methodName on every MonoBehaviour in this game object or any of its children.
CompareTagIs this game object tagged with tag ?
GetComponentReturns the component of Type type if the game object has one attached, null if it doesn't.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageCalls the method named methodName on every MonoBehaviour in this game object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

Static Functions

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares if two objects refer to the same.

Messages

OnJointBreakCalled when a joint attached to the same game object broke.