SetWaterPosition

Definition

SetWaterPosition(string waterName, float x, float y, float z)

Description

This function sets the position of the water waterName.

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.

x, y, z
Specify the X, Y and Z components of water position.

Example 1

function Init()
    SetWaterPosition("water1", 1.5, -2.0, 4.0)
end

function Update()

end
In this example, we set the position of water “water1” to (1.5, -2.0, 4.0).

Example 2

--Name of script is SetWaterPosition2.lua

function Init()
    SetWaterPosition("this", 4.7, 1.0, -3.6)
end

function Update()

end
Assume that the above script named SetWaterPosition2.lua is attached to a water object named “water1”. In this case, string “this”  in the SetWaterPosition function will be equal to “water1”. In our example, the function SetWaterPosition sets the position of current water, which is “water1”, to (4.7, 1.0, -3.6).
adminSetWaterPosition