Camera::Camera

From RAGE Multiplayer Wiki
Revision as of 07:59, 5 October 2020 by SugarD-x (talk | contribs) (Fixed client-side display code on second example. Cleaned up some grammatical and text display issues.)

Creates a camera.

Syntax

mp.cameras.new(name, position, rotation, fov);

Parameters

  • name: String
  • position: Vector3
  • rotation: Vector3
  • fov: Int

Examples

Creates a camera and sets it to look towards a location.

Version 0.3.7:

Client-Side
let sceneryCamera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40);

sceneryCamera.pointAtCoord(402.8664, -996.4108, -98.5); // Changes the rotation of the camera to point towards a location
sceneryCamera.setActive(true);
mp.game.cam.renderScriptCams(true, false, 0, true, false);


Version 1.1:

Client-Side
sceneryCamera.pointAtCoord(402.8664, -996.4108, -98.5); // PointAtCoord can't use Vector3 position in version 1.1. Use position.x, position.y, position.z instead.


See Also