Category: Environment / Effects
Since engine version: 6.0 OC
(extended in 9.0 OC)
Shake the player viewports near the given position. This disorienting effect is used for earthquakes, explosions and other rumbling effects. The further away the player is from the source, the less his viewport is shaken. The strength falls off linearly by distance from 100% to 0% when the player is [range] pixels away. The accumulated strength of all shake sources is limited to a distortion of at most 500 pixels per player.
void ShakeViewport(int level, int x, int x, int range);
- The strength of the shake in pixels. As a point of reference, for explosions, the shake strength is the same as the explosion level.
- X offset in relative coordinates from the calling object.
- Y offset in relative coordinates from the calling object.
- [opt] Range from shake center at which the effect falls off to zero. Defaults to 700.
See also: SetViewOffset