Skip to content

format

typescript
Rigidbody.AddForce(force, mode)

class: Rigidbody

description

Add force to a Rigidbody.

This method can be used to simulate the effect of an object being acted upon by an external force, such as pushing, pulling, or throwing. When a force is applied, the Rigidbody will generate corresponding acceleration and movement based on the laws of physics.

parameter

param_nametypedescription
forceVector3The force to be applied.
modeForceModeThe type of force to be applied.

reture

typedescription
void

code example