Camera::Camera: Difference between revisions

From RAGE Multiplayer Wiki
m (Added categories)
m (Replaced HTML with template)
Line 15: Line 15:
==Example==
==Example==
Creates a camera and sets it to look towards a location
Creates a camera and sets it to look towards a location
<div class="header" style="background-color: #AE4040; color: #FFFFFF; border: 2px solid #AE4040;">
{{ClientsideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div>
<pre>
<pre>
let sceneryCamera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40);
let sceneryCamera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40);
Line 24: Line 23:
mp.game.cam.renderScriptCams(true, false, 0, true, false);
mp.game.cam.renderScriptCams(true, false, 0, true, false);
</pre>
</pre>
</div>
}}


==See Also==
==See Also==

Revision as of 12:49, 26 October 2018

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

See Also