Camera::Camera: Difference between revisions

From RAGE Multiplayer Wiki
(Fixed client-side display code on second example. Cleaned up some grammatical and text display issues.)
(Undo revision 20521 by KirillZver (talk))
Tag: Undo
 
(One intermediate revision by the same user not shown)

Latest revision as of 01:01, 26 January 2021

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