SetWaterRotation

Definition

SetWaterRotation(string waterName, float rotationY)

Description

This function sets the rotation of water waterName around Y axis in degrees.

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.

rotationY
Specifies the rotation of water waterName  around Y axis in degrees.

Example 1

function Init()
    SetWaterRotation("water1", -37.5)
end

function Update()

end
In this script, we set the rotation of water “water1” around Y axis to -37.5 degrees.

Example 2

--Name of script is SetWaterRotation2.lua

function Init()
    SetWaterRotation("this", 127.4)
end

function Update()

end
Assume that the above script named SetWaterRotation2.lua is attached to a water object named “water1”. In this case, string “this”  in the SetWaterRotation function will be equal to “water1”. In our example, the function SetWaterRotation sets the Y rotation of current water, which is “water1”, to 127.4 degrees.
adminSetWaterRotation