Camera::destroy: Difference between revisions

From RAGE Multiplayer Wiki
 
Line 7: Line 7:
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
This example creates a camera and then destroys it.
<pre>
<pre>
let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera
let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera

Latest revision as of 23:27, 11 December 2020

Removes the camera.

Syntax

camera.destroy(destroy);

Required Arguments

  • destroy: Boolean

Return value

  • Undefined

Example

This example creates a camera and then destroys it.

let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera
camera.setActive(true);

// After 5 seconds destroys the camera.
setTimeout(function (){
  camera.destroy();
}, 5000)

See also