PRAS Documentation
  • 👋Welcome!
  • Basics
    • 🔫Recoil Animation
    • ⚙️Recoil Settings
  • Tutorials
    • 🌟Getting Set Up
Powered by GitBook
On this page
  • Step 1 - Recoil Animation Component
  • Step 2 - Initialize and Play
  • Step 3 - Animation Blueprint Integration
  • If you need help with IK
  1. Tutorials

Getting Set Up

In this tutorial you will learn how to set up the plugin.

PreviousRecoil Settings

Last updated 5 months ago

Tip: make sure to already implement basic firing logic in your project.

Step 1 - Recoil Animation Component

First, it is essential to add the Recoil Animation Component to the character.

UCLASS(config=Game)
class AYourCharacterClass : public ACharacter
{
    GENERATED_BODY()

public:
    AYourCharacterClass();

protected:
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Recoil")
    TObjectPtr<URecoilAnimationComponent> RecoilComponent;

    ...
};

Then, in your character class click on the RecoilAnimation component and specify the Helper UI:

The Helper UI is useful when you want to modify the recoil values in runtime in a very convenient way:

To enable this Helper UI in the game you can use the Blueprint-exposed methods:

Step 2 - Initialize and Play

Make sure to call the Init method of the Recoil Animation Component to initialize the recoil animation:

  • Data: Recoil Data asset.

  • Rate: fire rate or RPM (Rounds-per-minute).

  • Burst: length of the burst sequence.

Next, call Play and Stop methods when firing:

Note: Play must be called every shot!

Step 3 - Animation Blueprint Integration

Make sure to add a Recoil Animation node to the Anim Graph:

If you already have an IK system set up, select the IK or a VB (virtual bone) you want to animate with recoil in the node settings:

If you need help with IK

First, add Virtual Bones to the character head:

  • VB WeaponPivot targets ik_hand_gun.

  • VB hand_r targets hand_r.

  • VB hand_l targets hand_l.

Add CopyBone nodes before the Recoil Animation nodes:

If your animations do not keyframe the ik_hand_gun bone (it is used for baking gun movement into the character animation), you will have to use hand_r as a source bone in the first CopyBone node. You can additionally offset the VB WeaponPivot with a custom offset if you want more flexibility.

Finally, use Two Bone IK after the Recoil Animation node:


At this point, the setup is complete. If recoil is still not playing, double-check the steps above or:

  • Check if Recoil Data has any values.

  • The correct bone is animated by the RecoilAnimation.

  • Play method is called every shot.

  • The Fire Rate is in rounds-per-minute and greater than zero.

If the problem persists, feel free to post a ticket on our .

🌟
Discord
Select this blueprint.
How to use helper UI.
Init function.
Firing logic.
This node will apply recoil.
Node settings.
VB stands for Virtual Bone.
These will copy animation from FK bones to VBs.
IK pass.
Preferred IK settings.