Definition
SetWaterScale(string waterName, float scaleX, float scaleZ)
Description
This function sets the scale of water waterName in the X and Z direction.
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 name that this script is attached to.
scaleX, scaleZ
Specify the scale of water waterName in the X and Z direction. Each of these values must be equal to or greater than 0.01.
Example 1
function Init() SetWaterScale("water1", 11.5, 23.5) end function Update() end
In this example, SetWaterScale function sets the scale of water “water1” in the X and Z direction to 11.5 and 23.5, respectively.
Example 2
--Name of script is SetWaterScale2.lua function Init() SetWaterScale("this", 2.5, 14.2) end function Update() end
Assume that the above script named SetWaterScale2.lua is attached to a water object named “water1”. In this case, string “this” in the SetWaterScale function will be equal to “water1”. In our example, the function SetWaterScale sets the X and Z scale of current water, which is “water1”, to 2.5 and 14.2, respectively.
SetWaterScale