Description
The Radius
field represents the radius of a capsule. It is a public, non-static field of type System.Single
(float). The radius defines the distance from the center line of the capsule to its surface, effectively determining the thickness of the capsule.
Usage
To use the Radius
field, you can directly access it from an instance of the Capsule
struct. You can read or modify this field to get or set the radius of the capsule.
Example
// Example of using the Radius field
Capsule capsule = new Capsule();
capsule.Radius = 5.0f; // Set the radius of the capsule
float currentRadius = capsule.Radius; // Get the current radius of the capsule
// Use the radius in calculations or logic
if (currentRadius > 10.0f)
{
// Perform some action if the radius is greater than 10
}