Definition
SetWaterLightPosition(string waterName, float lx, float ly, float lz)
Description
This function sets the light (sun) position of the water waterName.
Parameters
waterName
Specifies the name of the water. You can also use the name “this” for this parameter. In this case, “this” refers to the water that this script is attached to.
lx, ly, lz
Specify the X, Y and Z components of the light position of water waterName.
Example 1
function Init() SetWaterLightPosition("water1", -14.5, 2.7, 23.0) end function Update() end
In this script, we set the light position of water “water1” to (-14.5, 2.7, 23.0).
Example 2
--Name of script is SetWaterLightPosition2.lua function Init() SetWaterLightPosition("this", 23.0, 3.5, 27.2) end function Update() end
Assume that the above script named SetWaterLightPosition2.lua is attached to a water object named “water1”. In this case, string “this” in the SetWaterLightPosition function will be equal to “water1”. In our example, the function SetWaterLightPosition sets the light position of current water, which is “water1”, to (23.0, 3.5, 27.2).
SetWaterLightPosition