How it works!
When a player presses the "Vault" input button, and the "VaultConditions" return true, the "Vault Type Check" function is initiated!
Vaulting and Climbing System
June 22, 2017 | Unreal Engine
This vaulting and climbing system I created, allows any object to be vaulted / climbed with a simple tag. A designer can add 1 of 3 tags (Vault, 1mClimb, FullClimb) to any actor object, and the player character will execute the proper animation corresponding to that tag.
When the vault type check is called, another function is immediately called. The "ClimbDistance & GroundCheck" gathers the information needed (Actors and Actor tags) to execute the vault.
Player InputAction calling the "Vault" function, if all "ValutingConditions" return true.
Distance and Ground Checks
Within this function, I fire two line traces. One below the player characters feet, and another is fired in the players forward movement direction. These line traces get and store the actor tag and a reference of the hit object and if it exists, a "ClimbableFace" component for the "FullClimb" tag.
This stored information will be used to determine whether or not the player can vault, and what type of vault they will be doing!
Executing the Vault!
Now that we have the the hit actors tag, we use a switch, which will run the behavior following the matching tag name.
The results of the switch will dictate the animations for the player character.
Before we set the animation, for the vault or climb. We need to know if the player has a weapon currently equipped or not. The animation will differ depending on the equipped state
Check it out!
Check out the scripts here:
Here we can see the results of the vault being executed, with a weapon equipped (Left) and without (Right)
Two line traces being fired getting the hit actor references and tags.
The switch event that will execute the Vault, 1mClimb, or FullClimb based on recorded tag.
Selecting the animation based on "WeaponEquipped" boolean value