The Radius
property of the CapsuleCollider
class represents the radius of the capsule shape used in collision detection. This property is a float
value that determines the thickness of the capsule's cylindrical part.
The Radius
property of the CapsuleCollider
class represents the radius of the capsule shape used in collision detection. This property is a float
value that determines the thickness of the capsule's cylindrical part.
To use the Radius
property, you can get or set its value to adjust the size of the capsule collider. This is useful for defining the collision boundaries of an object in a scene.
// Example of setting the radius of a CapsuleCollider CapsuleCollider capsuleCollider = new CapsuleCollider(); capsuleCollider.Radius = 1.5f; // Example of getting the radius of a CapsuleCollider float currentRadius = capsuleCollider.Radius; // Output the current radius // Note: Use a logging system instead of Console.WriteLine Log.Info($"Current Capsule Radius: {currentRadius}");