Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ConstantForce2D

Applies both linear and angular (torque) forces continuously to the rigidbody each physics update.
Read time 6 minutesLast updated 2 days ago

Definition

[RequireComponent(typeof(Rigidbody2D))]public sealed class ConstantForce2D : PhysicsUpdateBehaviour2D

Remarks

This is equivalent of calling Rigidbody2D.AddForce, Rigidbody2D.AddRelativeForce and Rigidbody2D.AddTorque each physics update. Additional Resources: Rigidbody2D.

Properties

Property

Description

forceThe linear force applied to the rigidbody each physics update.
relativeForceThe linear force, relative to the rigid-body coordinate system, applied each physics update.
torqueThe torque applied to the rigidbody each physics update.

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.