SetEngineCameraAngle

Definition

SetEngineCameraAngle(string engineCameraName, float angle)

Description

This function sets the angle value of the engine camera engineCameraName to angle.

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.

angle
Specifies the engine camera angle.

Example 1

function Init()
    ActivateEngineCamera("camera1")
    SetEngineCameraAngle("camera1", 30.0)
end

function Update()

end

function Update()

end
First we activate the engine camera “camera1”. Then we set the angle of engine camera “camera1” to 30.0 degrees.

Example 2

--Name of script is SetEngineCameraAngle2.lua

function Init()
    ActivateEngineCamera("this")
    SetEngineCameraAngle("this", 30.0)
end

function Update()

end
In this case, “this” string in the SetEngineCameraAngle points to the camera that SetEngineCameraAngle2.lua script is attached to. For example, if SetEngineCameraAngle2.lua script is attached to a engine camera named “camera1”, “this” will be equivalent to the name “camera1”. In this example, we activate the current engine camera (for example, “camera1”). Then we set the angle of current engine camera to 30.0 degrees.
adminSetEngineCameraAngle