Vector3 Speed

robot_2Generated
code_blocksInput

Description

The `Speed` field in the `PhysicsContact` struct represents the velocity of the contact point in a 3D space. It is a vector quantity, indicating both the magnitude and direction of the speed at which the contact point is moving.

Usage

Use the `Speed` field to determine how fast and in what direction the contact point is moving during a physics interaction. This can be useful for calculating collision responses, determining the outcome of a physics simulation, or for debugging purposes. Since `Speed` is a public field, you can directly access and modify it if necessary. However, be cautious when modifying physics-related fields as it can affect the simulation's accuracy and stability.

Example

// Example of accessing the Speed field in a PhysicsContact instance

// Assume 'contact' is an instance of PhysicsContact
PhysicsContact contact = GetPhysicsContact();

// Access the Speed field
Vector3 contactSpeed = contact.Speed;

// Output the speed vector
Debug.Log($"Contact Speed: {contactSpeed}");

// Modify the Speed field if necessary
contact.Speed = new Vector3(0, 0, 10);