SetWaterUnderwaterColor

Definition

SetWaterUnderwaterColor(string waterName, float red, float green, float blue)

Description

This function sets the underwater color of water waterName.

Parameters

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

red, green, blue
Specify the red, green and blue components of underwater color of water waterName. Each value is in the range [0.0,1.0].

Example 1

function Init()
    SetWaterUnderwaterColor("water1", 0.25, 0.5, 0.75)
end

function Update()

end
In this example, the SetWaterUnderwaterColor function sets the value of the red, green, and blue components of the underwater color of water “water1” to (0.25, 0.5, 0.75), respectively.

Example 2

--Name of script is SetWaterUnderwaterColor2.lua

function Init()
    SetWaterUnderwaterColor("this", 0.25, 0.5, 0.75)
end

function Update()

end
Assume that the above script named SetWaterUnderwaterColor2.lua is attached to a water object named “water1”. In this case, string “this”  in the SetWaterUnderwaterColor function will be equal to “water1”. In our example, the function SetWaterUnderwaterColor sets three values of red, green and blue underwater color of the water “water1”, to (0.25, 0.5, 0.75), respectively.
adminSetWaterUnderwaterColor