shakeCamera | Multi Theft Auto: Wiki Skip to content

shakeCamera

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows you to trigger camera shake effect (just like explosion does).

Note

The camera shaking duration depends on the force. High values ​​can result in very long durations

Syntax

shakeCamera ( )

Code Examples

client

This example allows you to constantly trigger camera shake effect in center of the map, the closer you are to center the stronger effect will be.

local shakeStrength = 1.4 -- define strength of the camera shake
local shakePosX, shakePosY, shakePosZ = 0, 0, 3 -- define position where camera shake would happen
function triggerCameraShake()
shakeCamera(shakeStrength, shakePosX, shakePosY, shakePosZ) -- trigger camera shake
end
setTimer(triggerCameraShake, 100, 0) -- call this function indefinitely, every 100 ms