Vector3 RandomPointOnEdge { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RandomPointOnEdge property of the Capsule struct returns a random point located on the edge of the capsule. This property is useful for scenarios where you need to sample points along the boundary of a capsule, such as in physics simulations or graphical effects.

Usage

To use the RandomPointOnEdge property, you must first have an instance of a Capsule. You can create a Capsule using the FromHeightAndRadius method or by directly setting its fields. Once you have a capsule, you can access the RandomPointOnEdge property to get a random point on its edge.

Example

// Create a capsule with a specific height and radius
Capsule capsule = Capsule.FromHeightAndRadius(10.0f, 2.0f);

// Get a random point on the edge of the capsule
Vector3 randomEdgePoint = capsule.RandomPointOnEdge;

// Use the random point for further processing, e.g., placing an object
// GameObject someObject = new GameObject();
// someObject.Position = randomEdgePoint;