ShakeCamera
Jump to navigation
Jump to search
Syntax
bool shakeCamera ( float power, [ float x, float y, float z ] )
Required arguments
- power: Intensity and time of the shake.
Optional Arguments
- x: Center X coordinate of the shake.
- y: Center Y coordinate of the shake.
- z: Center Z coordinate of the shake.
If not given, it will defaults to local player position.
Returns
Always returns true.
Example
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
See Also
- getCamera
- getCameraClip
- getCameraFieldOfView
- getCameraGoggleEffect
- getCameraViewMode
- setCameraClip
- setCameraFieldOfView
- setCameraGoggleEffect
- setCameraViewMode
- Shared
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget