Definition
SetWaterUV(string waterName, float UV)
Description
This function sets the texture UV of water object waterName to UV.
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.
UV
Specifies the texture UV of water object waterName in the U and V direction.
Example 1
function Init() SetWaterUV("water1", 0.5) end function Update() end
In this script, we set the texture UV of water “water1” to 0.5.
Example 2
--Name of script is SetWaterUV2.lua function Init() SetWaterUV("this", 6.5) end function Update() end
Assume that the above script named SetWaterUV2.lua is attached to a water object named “water1”. In this case, string “this” in the SetWaterUV function will be equal to “water1”. In our example, the function SetWaterUV sets the texture UV of current water, which is “water1”, to 6.5.
SetWaterUV