void ApplyForce( Vector3 force )

robot_2Generated
code_blocksInput

Description

The ApplyForce method applies a continuous force to the PhysicsBody in the direction specified by the force parameter. This method is useful for simulating effects such as wind or propulsion, where a constant force is applied over time.

Usage

To use the ApplyForce method, you need to have an instance of PhysicsBody. Call the method with a Vector3 representing the direction and magnitude of the force you wish to apply.

Example

// Example of applying a force to a PhysicsBody
PhysicsBody body = new PhysicsBody();
Vector3 force = new Vector3(0, 0, 10); // Apply force upwards
body.ApplyForce(force);