float StartDistance { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The StartDistance property of the GradientFogController class specifies the distance from the camera at which the fog effect begins. This property is a float value representing the start point of the fog in world units. Adjusting this value allows you to control how close or far the fog starts relative to the camera, which can be useful for creating atmospheric effects in your scene.

Usage

To use the StartDistance property, you need to have an instance of the GradientFogController class. You can then set or get the StartDistance to control where the fog effect begins in your scene.

Example

// Create an instance of GradientFogController
GradientFogController fogController = new GradientFogController();

// Set the start distance of the fog to 50 units
fogController.StartDistance = 50.0f;

// Get the current start distance of the fog
float currentStartDistance = fogController.StartDistance;

// Output the current start distance
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use in-game debugging tools or UI elements to display this value
// Debug.Log($"Current Start Distance: {currentStartDistance}");