GetEngineCameraAngle

Definition

double GetEngineCameraAngle(string engineCameraName)

Description

This function returns the angle 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

Angle of the engineCameraName engine camera.

Example 1

angle = 0.0

function Init()
    angle = GetEngineCameraAngle("camera1")

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

function Update()

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

Example 2

--Name of script is GetEngineCameraAngle2.lua

angle = 0.0

function Init()
    angle = GetEngineCameraAngle("this")

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

function Update()

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