Camera::destroy: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Removes the camera.
Removes the camera.
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">camera.destroy(destroy);</syntaxhighlight>
<pre>camera.destroy(destroy);</pre>
=== Required Arguments ===
=== Required Arguments ===
*'''destroy:''' Boolean
*'''destroy:''' Boolean
Line 7: Line 7:
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
This example creates a camera and then destroys it.
// todo
<pre>
</syntaxhighlight>
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)
</pre>
 
==See also==
==See also==
{{Camera_definition_c}}
{{Camera_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:Camera API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

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