pub struct TargetJoint2D {Show 13 fields
pub m_Anchor: Vector2f,
pub m_AutoConfigureTarget: bool,
pub m_BreakForce: f32,
pub m_BreakTorque: f32,
pub m_ConnectedRigidBody: PPtr,
pub m_DampingRatio: f32,
pub m_EnableCollision: bool,
pub m_Enabled: u8,
pub m_Frequency: f32,
pub m_GameObject: PPtr,
pub m_MaxForce: f32,
pub m_Target: Vector2f,
pub m_BreakAction: Option<i32>,
}Expand description
TargetJoint2D is a class of the Unity engine since version 5.3.0f1. Exert from Unity’s scripting documentation: The joint attempts to move a Rigidbody2D to a specific target position. This joint is the only joint that doesn’t connect two Rigidbody2D together. Instead, it only operates on the single body it is connected to.When connected, it will attempt to move the body to a specified target position. When setting a target you can also set the anchor position which is a point relative to the Rigidbody2D where forces will be applied.The joint moves the body using a configurable spring that has a force limit.An example usage for this joint might be to enable Collider2D to be dragged, selecting an anchor point and moving the body to the position under the mouse.
Fields§
§m_Anchor: Vector2fThe local-space anchor on the rigid-body the joint is attached to.
m_AutoConfigureTarget: boolShould the target be calculated automatically?
m_BreakForce: f32The force that needs to be applied for this joint to break.
m_BreakTorque: f32The torque that needs to be applied for this joint to break.
m_ConnectedRigidBody: PPtrPPtr<Rigidbody2D>: (5.3.0f1 - 2022.3.2f1)
m_DampingRatio: f32The amount by which the target spring force is reduced in proportion to the movement speed.
m_EnableCollision: boolShould the two rigid bodies connected with this joint collide with each other?
m_Enabled: u8Enabled Behaviours are Updated, disabled Behaviours are not.
m_Frequency: f32The frequency at which the target spring oscillates around the target position.
m_GameObject: PPtrThe game object this component is attached to. A component is always attached to a game object.
PPtr<GameObject>: (5.3.0f1 - 2022.3.2f1)
m_MaxForce: f32The maximum force that can be generated when trying to maintain the target joint constraint.
m_Target: Vector2fThe world-space position that the joint will attempt to move the body to.
m_BreakAction: Option<i32>The action to take when the joint breaks the breakForce or breakTorque. i32: (2022.2.0b1 - 2022.3.2f1)