Camera::stopShaking: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{JSContainer|
=== Required Arguments ===
*'''stopImmediately:''' Boolean


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">camera.stopShaking(p1);</syntaxhighlight>
<syntaxhighlight lang="javascript">camera.stopShaking(stopImmediately);</syntaxhighlight>
=== Required Arguments ===
 
*'''p1:''' Boolean
===Return value===
===Return value===
*'''Undefined'''
*'''void'''
 
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const cam = mp.cameras.new('newcamera', mp.players.local.position, new mp.Vector3(0, 0, 0), 40);
mp.game.cam.renderScriptCams(true, true, 1000, false, false, 0);
 
cam.shake("SMALL_EXPLOSION_SHAKE", 1.0);
 
//stop shaking camera after 5 seconds.
setTimeout(() => {
    if (cam && mp.cameras.exists(cam)) {
        cam.stopShaking(true);
    }
}, 5000);
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Camera_function_c}}
{{Camera_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 08:49, 23 April 2024

JavaScript Syntax


Required Arguments

  • stopImmediately: Boolean

Syntax

camera.stopShaking(stopImmediately);

Return value

  • void

Example

const cam = mp.cameras.new('newcamera', mp.players.local.position, new mp.Vector3(0, 0, 0), 40);
mp.game.cam.renderScriptCams(true, true, 1000, false, false, 0);

cam.shake("SMALL_EXPLOSION_SHAKE", 1.0);

//stop shaking camera after 5 seconds.
setTimeout(() => {
    if (cam && mp.cameras.exists(cam)) {
        cam.stopShaking(true);
    }
}, 5000);


See also