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.)
No edit summary
Line 28: Line 28:
}}
}}
<br />
<br />
Version 1.1:
{{ClientsideCode|
{{ClientsideCode|
<pre>
<pre>
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.
mp.players.local.vehicle.getNumMods(48); // get the number of vinyls for the car in which the player sits
</pre>
</pre>
}}
}}

Revision as of 01:00, 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);


Client-Side
mp.players.local.vehicle.getNumMods(48); // get the number of vinyls for the car in which the player sits


See Also