void ApplyImpulseAt( Vector3& position, Vector3& force )

robot_2Generated
code_blocksInput

Description

The ApplyImpulseAt method applies an instant linear impulse to the Rigidbody at a specified position. This is typically used to simulate effects like a bullet impact, where a sudden force is applied to a specific point on the object.

Usage

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

  • position: A reference to a Vector3 that specifies the position on the Rigidbody where the impulse should be applied.
  • force: A reference to a Vector3 that specifies the direction and magnitude of the impulse to be applied.

This method does not return a value.

Example

// Example of using ApplyImpulseAt
Rigidbody rigidbody = new Rigidbody();
Vector3 position = new Vector3(1.0f, 0.0f, 0.0f); // Position where the impulse is applied
Vector3 force = new Vector3(10.0f, 0.0f, 0.0f);   // Impulse force

// Apply an impulse at the specified position
rigidbody.ApplyImpulseAt(ref position, ref force);