Aim Punch

The Aim Punch effect quickly "punches" the camera's rotation in one direction then resets to the resting position. This is often used to indicate the player was hit by an object or attack.

🥊 Settings

Multiple aim punch profiles can be created for different purposes. The following settings are available to customize on each profile:

  • Strength: The strength of the punch. The higher the value, the more the camera will be rotated.

  • Decay Rate: How quickly the camera resets back to a resting position. The higher the value, the faster the camera will reset.

  • Direction: A min and max vector indicating the direction of the punch. The min and max vectors are used to randomize the punch direction. They can be set to the same value to make the punch always in a single direction.

🖱️ Usage

Assuming you have a reference to the Camera Controller, you can get a reference to the aim punch module then activate it manually:

AimPunch aimPunch = cameraController.GetModule<AimPunch>();

aimPunch.Activate(); // default/current profile
aimPunch.Activate("EnemyAttack"); // custom profile

The aim punch is automatically deactivated, but it can be manually deactivated at any time:

AimPunch aimPunch = cameraController.GetModule<AimPunch>();

aimPunch.Deactivate(); // default/current profile
aimPunch.Deactivate("EnemyAttack"); // custom profile

🧰 Scripting API