Description
The GetVelocityAtPoint
method of the Rigidbody
class returns the world space velocity of a specific point on the object. This is particularly useful for objects that are rotating around their own axis or origin, as it allows you to determine the velocity at any given point on the object's surface.
Usage
To use the GetVelocityAtPoint
method, you need to pass a reference to a Vector3
representing the position in world space where you want to calculate the velocity. The method will return a Vector3
that represents the velocity at that point.
Example
// Example usage of GetVelocityAtPoint
Rigidbody rigidbody = new Rigidbody();
Vector3 point = new Vector3(1.0f, 2.0f, 3.0f);
Vector3 velocityAtPoint = rigidbody.GetVelocityAtPoint(ref point);
// velocityAtPoint now contains the velocity of the rigidbody at the specified point.