Version: 2017.3

HingeJoint

class in UnityEngine

/

Inherits from:Joint

Switch to Manual

Description

The HingeJoint groups together 2 rigid bodies, constraining them to move like connected by a hinge.

This joint is great for, well, doors, but can also be used to model chains, etc...

The HingeJoint has a motor which can be used to make the hinge spin around the joints axis. A spring which attempts to reach for a target angle by spinning around the joints axis. And a limit which constrains the joint angle.

Variables

angleThe current angle in degrees of the joint relative to its rest position. (Read Only)
limitsLimit of angular rotation (in degrees) on the hinge joint.
motorThe motor will apply a force up to a maximum force to achieve the target velocity in degrees per second.
springThe spring attempts to reach a target angle by adding spring and damping forces.
useLimitsEnables the joint's limits. Disabled by default.
useMotorEnables the joint's motor. Disabled by default.
useSpringEnables the joint's spring. Disabled by default.
velocityThe angular velocity of the joint in degrees per second. (Read Only)

Inherited members

Variables

gameObjectИгровой объект к которому прикреплён данный компонент. Компонент всегда прикреплён к игровому объекту.
tagТег данного игрового объекта.
transformThe Transform attached to this GameObject.
anchorПозиция якоря, вокруг которого сустав вынужден двигаться.
autoConfigureConnectedAnchorДолжен ли connectedAnchor рассчитываться автоматически?
axisНаправление осей, вокруг которых тело вынуждено двигаться.
breakForceСила, требуемая для разрыва данного сустава.
breakTorqueКрутящий момент, необходимый для разрыва данного сустава.
connectedAnchorПозиция якоря относительно присоединенного Rigidbody.
connectedBodyСсылка для подсоединения данного сустава к другому твердому телу.
connectedMassScaleThe scale to apply to the inverse mass and inertia tensor of the connected body prior to solving the constraints.
currentForceThe force applied by the solver to satisfy all constraints.
currentTorqueThe torque applied by the solver to satisfy all constraints.
enableCollisionВключенная коллизия между телами подсоединяется суставом.
enablePreprocessingToggle preprocessing for this joint.
massScaleThe scale to apply to the inverse mass and inertia tensor of the body prior to solving the constraints.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

BroadcastMessageВызывает метод названный methodName на каждом MonoBehaviour этого game object-а или любого из его потомков.
CompareTagПомечен ли данный игровой объект тегом tag?
GetComponentВозвращает компонент типа type, если он прикреплен к игровому объекту и null, если не прикреплен.
GetComponentInChildrenВозвращает компонент типа type в GameObject или некоторого его потомка через поиск в глубину.
GetComponentInParentВозвращает все компоненты типа type из GameObject'а или из любого его родителя.
GetComponentsВозвращает все компоненты типа type в GameObject.
GetComponentsInChildrenВозвращает все компоненты типа type в GameObject или любому из его потомков.
GetComponentsInParentВозвращает все компоненты типа type в GameObject или любому из его родителей.
SendMessageВызывает метод с названием methodName в каждом MonoBehaviour в этом игровом объекте.
SendMessageUpwardsВызывает метод с именем methodName в каждом MonoBehaviour в этом игровом объекте и в каждом предке поведения.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the GameObject.

Static Functions

DestroyУдаляет GameObject, Component или 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 two object references to see if they refer to the same object.

Messages

OnJointBreakВызывается при разрушении сустава, прикрепленного к такому же игровому объекту.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961