void ApplyForceAt( Vector3 position, Vector3 force )

robot_2Generated
code_blocksInput

Description

The ApplyForceAt method applies a force to the PhysicsBody at a specified position. This method is useful for simulating realistic physical interactions where the point of force application affects the resulting motion, such as applying a force to a specific part of an object to make it spin or move in a particular direction.

Usage

To use the ApplyForceAt method, you need to provide two parameters:

  • position: A Vector3 representing the world position where the force is applied.
  • force: A Vector3 representing the magnitude and direction of the force to be applied.

This method does not return a value.

Example

// Example of using ApplyForceAt
PhysicsBody physicsBody = new PhysicsBody();
Vector3 forcePosition = new Vector3(1.0f, 0.0f, 0.0f); // Position where the force is applied
Vector3 forceVector = new Vector3(0.0f, 10.0f, 0.0f); // Force vector

// Apply the force at the specified position
physicsBody.ApplyForceAt(forcePosition, forceVector);