CreateCamera

From GT-MP
Jump to: navigation, search
CreateCamera
Client-Side Function
System-users.png Client-Side Javascript.png JavaScript

Creates a new Camera - this is just a plain variable and not shown in any way to the player.

Syntax

In Javascript
Client-Side Function

API.createCamera(Vector3 position, Vector3 rotation);
  • position: parameter input should be in Vector3 type.
  • rotation: parameter input should be in Vector3 type.

Usage example

  • An example for creating and showing a new camera at the player's position.
let player = API.getLocalPlayer();
let playerPos = API.getEntityPosition(player);
let playerRot = API.getEntityRotation(player);

let newCamera = API.createCamera(playerPos, playerRot);
API.setActiveCamera(newCamera);

References