This tutorial shows how you can set up the Vault and Mantle ability using the Third Person Template and the VaultOver
animation from the Windwalker Echo, both provided by Epic.
It should be pretty straightforward to set it up on any project, just follow along and adjust according to your specific project details.
Launch the editor and go to Edit > Plugins
and enable the following plugins:
Just simple add the MotionWarpingComponent
to your Blueprint Character:
For the sake of simplifying things a bit, let's set up the Gameplay Ability System Component
in the Character
.
First, add the necessary dependencies to the project:
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"InputCore",
"EnhancedInput",
"GameplayAbilities",
"GameplayTags",
"GameplayTasks",
}
);
In your YourCharacterClass.h
add #include <AbilitySystemInterface.h>
and forward declare the ability system component.
Also add the interface to the character and the GetAbilitySystemComponent
method declaration. You should have something like the following:
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include <AbilitySystemInterface.h>
#include "YourCharacterClass.generated.h"
class UAbilitySystemComponent;
UCLASS(config=Game)
class AYourCharacterClass : public ACharacter, public IAbilitySystemInterface
{
GENERATED_BODY()
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = GameplayAbility, meta = (AllowPrivateAccess = "true"))
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
// other stuff
public:
// Begin Ability System Interface
UAbilitySystemComponent* GetAbilitySystemComponent() const override;
// End Ability System Interface
}
In your AYourCharacterClass.cpp
file include the AbilitySystemComponent.h
header, add the GetAbilitySystemComponent
method implementation, and also setup the AbilitySystemComponent
like so:
// other includes
#include <AbilitySystemComponent.h>
AYourCharacterClass::AYourCharacterClass()
{
AbilitySystemComponent = CreateDefaultSubobject<UAbilitySystemComponent>(TEXT("AbilitySystemComponent"));
AbilitySystemComponent->SetIsReplicated(true);
AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);
}
UAbilitySystemComponent* AYourCharacterClass::GetAbilitySystemComponent() const
{
return AbilitySystemComponent;
}
For simplicity, let's grant the ability on Character's BeginPlay
event callback:
If needed open the GA_VaultMantle
ability and setup its parameters such as montages to play, size of trace box, and so on:
Create a new InputAction so we can trigger the ability by pressing a key:
Add it to your InputMappingContext like so:
For this example we're going to activate the ability by using its gameplay tag everytime we press the input key:
Unfortunately no. There is another plugin coming soon that will enable projects without GAS to have this gameplay mechanic. Stay tuned.
Yes, but if you want to use it with the Lyra Ability Set (ULyraAbilitySet
) it requires you to create a new C++ ability based on the ULyraGameplayAbility
.
You can simple copy and paste the relevant code from the UGameplayAbility_VaultMantle
and that's it.
If using the Windwalker Echo
animation make sure to retarget to Lyra's character skeleton.
When opening the montage you should get something similar to the following screens:
Pick a replacement for the skeleton: