GetEngineCameraPan

Definition

double GetEngineCameraPan(string engineCameraName)

Description

This function returns the pan of the engineCameraName engine camera.

Parameters

engineCameraName
Specifies the name of the engine camera. You can also use the name “this” for this parameter. In this case, “this” refers to the camera object that this script is attached to.

Return Value

Pan of the engineCameraName engine camera.

Example 1

pan = 0.0

function Init()
    pan = GetEngineCameraPan("camera1")

    message = string.format("\nPan is > %.2f" , pan )
    PrintConsole(message)
end

function Update()

end
Returns the pan of the “camera1” engine camera.

Example 2

--Name of script is GetEngineCameraPan2.lua

pan = 0.0

function Init()
    pan = GetEngineCameraPan("this")

    message = string.format("\nPan is > %.2f" , pan )
    PrintConsole(message)
end

function Update()

end
In this case, “this” string in the GetEngineCameraPan points to the camera that GetEngineCameraPan2.lua script is attached to. For example, if GetEngineCameraPan2.lua script is attached to a engine camera named “camera1”, “this” will be equivalent to the name “camera1”. In this example, GetEngineCameraPan function returns the pan of current engine camera.
adminGetEngineCameraPan