Definition
SetWaterFlowSpeed(string waterName, float speed)
Description
This function sets the flow speed of water object waterName to speed.
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.
speed
Specifies the flow speed of water object waterName to be set.
Example 1
function Init() SetWaterFlowSpeed("water1", 1.1) end function Update() end
In this script, we set the flow speed of water “water1” to 1.1.
Example 2
--Name of script is SetWaterFlowSpeed2.lua function Init() SetWaterFlowSpeed("this", -0.05) end function Update() end
Assume that the above script named SetWaterFlowSpeed2.lua is attached to a water object named “water1”. In this case, string “this” in the SetWaterFlowSpeed function will be equal to “water1”. In our example, the function SetWaterFlowSpeed sets the flow speed of current water, which is “water1”, to -0.05.
SetWaterFlowSpeed