User Tools

Site Tools


rotate_camera_over_time

Rotate Camera Over Time


Rotates the camera horizontally and/or vertically by the specified number of degrees over a period of time (in seconds). The angles are relative to the current view. A positive horizontal angle will rotate the camera to the right and a negative horizontal angle will rotate the camera to the left. Likewise, a positive vertical angle will rotate the camera upwards and a negative vertical angle will rotate the camera downwards.

Signature:

rotate_camera_over_time(horizontal_angle, vertical_angle, duration)
ArgumentDescriptionTypeRequired
horizontal_angleAngle by which to rotate the camera left or right (in degrees).NumberYes
vertical_angleAngle by which to rotate the camera up or down (in degrees).NumberYes
durationDuration of the camera rotation (in seconds).NumberYes

Lock Camera must be called before using this function to prevent the player from manually controlling the camera.

Example:

rotate_camera_over_time(-40, 0, 1);

Results: The camera is rotated 40 degrees to the left over a duration of one second.

Use the Rotate Camera Over Time function to focus the camera towards an event taking place during a cutscene. This is particularly useful in first-person mode since the camera rotations will be relative to the player's view.


Editor Node:

Visual Demo:

rotate_camera_over_time.txt · Last modified: 2021/04/21 18:48 by justin