Camera::Camera

From RAGE Multiplayer Wiki
Revision as of 13:26, 26 July 2020 by Hek (talk | contribs) (Comment for Rage 1.1 added)

Creates a camera.

Syntax

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

Parameters

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

Example

Creates a camera and sets it to look towards a location

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);

Comment Rage 1.1

Creates a camera and sets it to look towards a location {{ClientsideCode|

sceneryCamera.pointAtCoord(402.8664, -996.4108, -98.5);
pointAtCoord can't use Vector3 position in Rage 1.1, use position.x, position.y, position.z instead.


See Also