SetWaterUnderwaterFogDensity

Definition

SetWaterUnderwaterFogDensity(string waterName, float density)

Description

This function sets the underwater fog density of water object waterName.

Parameters

waterName
Specifies the water name. You can also use the name “this” for this parameter. In this case, “this” string refers to the name of the water to which this script is attached.

density
Specifies the underwater fog density of water object waterName. This value must be equal to or greater than 0.0.

Example 1

function Init()
    SetWaterUnderwaterFogDensity("water1", 0.15)
end

function Update()

end
In this script, we set the underwater fog density of water “water1” to 0.15.

Example 2

--Name of script is SetWaterUnderwaterFogDensity2.lua

function Init()
    SetWaterUnderwaterFogDensity("this", 0.2)
end

function Update()

end
Assume that the above script named SetWaterUnderwaterFogDensity2.lua is attached to a water object named “water1”. In this case, string “this”  in the SetWaterUnderwaterFogDensity function will be equal to “water1”. In our example, the function SetWaterUnderwaterFogDensity sets the underwater fog density of current water, which is “water1”, to 0.2.
adminSetWaterUnderwaterFogDensity