EZ Camera Shake Guide & Docs
EZ%20Camera%20Shake%20Guide%20%26%20Docs
EZ%20Camera%20Shake%20Guide%20%26%20Docs
EZ%20Camera%20Shake%20Guide%20%26%20Docs
EZ%20Camera%20Shake%20Guide%20%26%20Docs
EZ%20Camera%20Shake%20Guide%20%26%20Docs
User Manual: Pdf
Open the PDF directly: View PDF .
Page Count: 8

1
EZ Camera Shake v1.0.2
Created By Kevin Somers
Contents
Overview ............................................................................................................................................................................. 2
Setting Up the Camera Shake .................................................................................................................................... 2
Using the Camera Shake .............................................................................................................................................. 3
Managing CameraShaker Components ............................................................................................................. 3
The CameraShakeInstance ...................................................................................................................................... 3
Shake Methods ............................................................................................................................................................ 4
Shake .......................................................................................................................................................................... 4
ShakeOnce ................................................................................................................................................................ 4
StartShake ................................................................................................................................................................. 4
Scripting .............................................................................................................................................................................. 5
CameraShaker .............................................................................................................................................................. 5
Shake .......................................................................................................................................................................... 5
ShakeOnce (Overload 1) ..................................................................................................................................... 5
ShakeOnce (Overload 2) ..................................................................................................................................... 5
StartShake (Overload 1)....................................................................................................................................... 6
StartShake (Overload 2)....................................................................................................................................... 6
ShakeInstances (List<CameraShakeInstance>) .......................................................................................... 6
CameraShakeInstance ............................................................................................................................................... 7
CameraShakeInstance (Overload 1) ................................................................................................................ 7
CameraShakeInstance (Overload 2) ................................................................................................................ 7
StartFadeIn ............................................................................................................................................................... 7
StartFadeOut ........................................................................................................................................................... 7
ScaleMagnitude (Float) ........................................................................................................................................ 7
ScaleRoughness (Float) ........................................................................................................................................ 7
Magnitude (Float) .................................................................................................................................................. 7
Roughness (Float) .................................................................................................................................................. 8
PositionInfluence (Vector3) ................................................................................................................................ 8
RotationInfluence (Vector3) ............................................................................................................................... 8
DeleteOnInactive (Boolean) ............................................................................................................................... 8
NormalizedFadeTime (Float) ............................................................................................................................. 8
CurrentState (CameraShakeState) ................................................................................................................... 8

2
Overview
This package provides an easy-to-use implementation of a procedural camera shake animation.
It works on both static and moving cameras.
Included in this package is a bonus camera follow script, which can be used in a variety of
situations.
Setting Up the Camera Shake
In order for the
CameraShaker
component to work properly, there are 2 rules that must be
followed:
1) Your Main Camera must be the child of a GameObject, and its local position and rotation
must be set to (0, 0, 0)
2) Any scripts that move the camera must NOT be placed on the same object as the
CameraShaker
script. Put these on the Camera’s parent instead.
The
CameraShaker
component has 2 fields:
Default Pos Influence: The default influence shakes have over the camera’s position.
This can be altered on a per-shake basis.
Default Rot Influence: The default influence shakes have over the camera’s rotation.
This can be altered on a per-shake basis.

3
Using the Camera Shake
Managing CameraShaker Components
Using the camera shake script can require management of different instances, if you have
multiple cameras.
If you only have one main camera with the
CameraShaker
script in your scene, then you can use
the
CameraShaker
.Instance static field to access the main camera.
If you have more than one camera in your scene, then you can use
CameraShaker
.GetInstance(name) static method to access the different instances. Name
corresponds to the Gameobject name the
CameraShaker
script is attached to.
Alternatively, you can implement your own manager if the previous two options do not meet
your needs. All you need to store are references to the needed
CameraShaker
components.
The CameraShakeInstance
The
CameraShakeInstance
is a class that holds data about a shake. The
CameraShaker
component holds a list of all active
CameraShakeInstances
, and applies the shake values of
each one additively.
CameraShakeInstances
have these main properties:
Magnitude: The intensity of the shake.
Roughness: How rough the shake is. Lower values are smooth and slow, higher values
are rough and fast.
PositionInfluence: How much this shake influences the position of the camera. These
values are measured on the local axes of the camera.
Rotation Influence: How much this shake influences the rotation of the camera. These
values are measured on the local axes of the camera.
CurrentState: The current state of the shake. A shake can be fading in, fading out,
sustained, or inactive.
DeleteOnInactive: Whether or not the
CameraShaker
component should delete this
instance when its state is inactive.
CameraShakeInstances
also have several other methods and properties that control the shake:
StartFadeIn: Fades in over the given time span.
StartFadeOut: Fades out over the given time span. Will set the state to Inactive when
finished, so make sure to set DeleteOnInactive to false if you don’t want it to be
deleted.
ScaleMagnitude: Scales the magnitude value.
ScaleRoughness: Scales the roughness value.

4
Shake Methods
There are several different methods you can use to initiate a new shake. All methods return their
corresponding
CameraShakeInstance
, which can be used to modify shake properties at
runtime.
Shake
Initiates a camera shake using a predefined
CameraShakeInstance
. This package includes a set
of presets that can be used by this method under the
CameraShakePresets
class, or you can
define you own presets and use them here.
ShakeOnce
Initiates a one-shot shake that fades in and then fades out automatically. This kind of shake is
best used for explosions, bumps, or other short-lived shakes.
StartShake
Starts a sustained shake that will continue until it is told to stop using StartFadeOut. You must
store the
CameraShakeInstance
variable returned by this function in order to stop the shake or
alter its properties.

5
Scripting
CameraShaker
Shake
Initiates a shake using the given CameraShakeInstance.
Parameters:
Preset (CameraShakeInstance): The CameraShakeInstance to initiate.
Returns:
A reference to the created shake (CameraShakeInstance).
ShakeOnce (Overload 1)
Initiates a one-shot shake.
Parameters:
Magnitude (Float): The intensity of the shake.
Roughness (Float): How rough the shake is. Lower values are slow and smooth, higher
values are fast and jarring.
FadeInTime (Float): The time, in seconds, for the shake to fade in.
FadeOutTime (Float): The time, in seconds, for the shake to fade out.
Returns:
A reference to the created shake (CameraShakeInstance).
ShakeOnce (Overload 2)
Initiates a one-shot shake.
Parameters:
Magnitude (Float): The intensity of the shake.
Roughness (Float): How rough the shake is. Lower values are slow and smooth, higher
values are fast and jarring.
FadeInTime(Float): The time, in seconds, for the shake to fade in.
FadeOutTime (Float): The time, in seconds, for the shake to fade out.
PosInfluence (Vector3): How much this shake influences the position of the camera.
This is relative to its local axes.
RotInfluence (Vector3): How much this shake influences the rotation of the camera.
This is relative to its local axes.
Returns:
A reference to the created shake (CameraShakeInstance).

6
StartShake (Overload 1)
Initiates a sustained shake.
Parameters:
Magnitude (Float): The intensity of the shake.
Roughness (Float): How rough the shake is. Lower values are slow and smooth, higher
values are fast and jarring.
FadeInTime (Float): The time, in seconds, for the shake to fade in.
Returns:
A reference to the created shake (CameraShakeInstance).
StartShake (Overload 2)
Initiates a sustained shake.
Parameters:
Magnitude (Float): The intensity of the shake.
Roughness (Float): How rough the shake is. Lower values are slow and smooth, higher
values are fast and jarring.
FadeInTime (Float): The time, in seconds, for the shake to fade in.
PosInfluence (Vector3): How much this shake influences the position of the camera.
This is relative to its local axes.
RotInfluence (Vector3): How much this shake influences the rotation of the camera.
This is relative to its local axes.
Returns:
A reference to the created shake (CameraShakeInstance).
ShakeInstances (List<CameraShakeInstance>)
Returns the list of CameraShakeInstances.

7
CameraShakeInstance
CameraShakeInstance (Overload 1)
Creates a new one-shot instance.
Parameters:
Magnitude (Float): The intensity of the shake.
Roughness (Float): How rough the shake is. Lower values are slow and smooth, higher
values are fast and jarring.
FadeInTime (Float): The time, in seconds, for the shake to fade in.
FadeOutTime (Float): The time, in seconds, for the shake to fade out.
CameraShakeInstance (Overload 2)
Creates a new sustained instance.
Parameters:
Magnitude (Float): The intensity of the shake.
Roughness (Float): How rough the shake is. Lower values are slow and smooth, higher
values are fast and jarring.
StartFadeIn
Starts a fade in of the shake.
Parameters:
FadeInTime (Float): The time, in seconds, for the shake to fade in.
StartFadeOut
Starts a fade out of the shake.
Parameters:
FadeOutTime (Float): The time, in seconds, for the shake to fade out.
ScaleMagnitude (Float)
Scales this shake's magnitude while preserving the initial Magnitude.
ScaleRoughness (Float)
Scales this shake's roughness while preserving the initial Roughness.
Magnitude (Float)
The intensity of the shake.

8
Roughness (Float)
How rough the shake is. Lower values are slow and smooth, higher values are fast and jarring.
PositionInfluence (Vector3)
How much this shake influences the position of the camera. This is relative to its local axes.
RotationInfluence (Vector3)
How much this shake influences the rotation of the camera. This is relative to its local axes.
DeleteOnInactive (Boolean)
Whether or not this shake should be deleted by the
CameraShaker
component when its state is
Inactive.
NormalizedFadeTime (Float)
A normalized value (about 0 to about 1) that represents the current level of intensity.
CurrentState (CameraShakeState)
The current state of the shake. A shake can be FadingIn, FadingOut, Sustained, or Inactive.