Using the Emerald AI Camera Shake System - Black-Horizon-Studios/Emerald-AI GitHub Wiki

Using the Emerald AI Camera Shake System

Emerald AI includes a camera shake system that will fade in and out a shaking effect. The intensity and duration of this can be adjusted. The camera shake system is a separate system from the Emerald AI system.

Step 1

In order to use the camera shake system, first you will need to drag and drop the Camera Shake System prefab into your scene. This is located under Emerald AI>Prefabs>Camera Shake.

Step 2

Next, apply your camera to the Camera Transform of the Camera Shake System.

Step 3

The camera shake system is now setup and ready to be used. In order for it to trigger a camera shake, you must use a certain line of code. This line of code does everything for you. All you have to do is specify the ShakeTime (the first parameter) and ShakeAmount (the second parameter).

You can use a camera shake effect for wherever you want such as for an event, for critical hits, regular hits, quests, etc. To do this, you simple use the CameraShake function like below. Note: The Camera Shake System must be in your scene, with a Camera Transform applied, in order to avoid any errors.

EmeraldAI.CameraShake.Instance.ShakeCamera(0.32f, 0.35f);

An example of the camera shake effect that happens when the player has a critical hit towards the enemy.