pub struct ConstantForce {
pub m_Enabled: u8,
pub m_Force: Vector3f,
pub m_GameObject: PPtr,
pub m_RelativeForce: Vector3f,
pub m_RelativeTorque: Vector3f,
pub m_Torque: Vector3f,
}Expand description
ConstantForce is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: A force applied constantly. This is a small physics utility class used to apply a continous force to an object.Rigidbody.AddForce applies a force to the Rigidbody only for one frame, thus you have to keep calling the function.
ConstantForce on the other hand will apply the force every frame until you change the force or torque to a new value.See Also: Rigidbody.
Fields§
§m_Enabled: u8Enabled Behaviours are Updated, disabled Behaviours are not.
m_Force: Vector3fThe force applied to the rigidbody every frame.
m_GameObject: PPtrThe game object this component is attached to. A component is always attached to a game object.
PPtr<GameObject>: (3.4.0 - 2022.3.2f1)
m_RelativeForce: Vector3fThe force - relative to the rigid bodies coordinate system - applied every frame.
m_RelativeTorque: Vector3fThe torque - relative to the rigid bodies coordinate system - applied every frame.
m_Torque: Vector3fThe torque applied to the rigidbody every frame.