Ledge Grab system p1 — Ledge Grab Checker
In this article, we will start implementing a Ledge Grab System. In this part of the tutorial we will be checking if a player is trying to grab a ledge.
First, go to Maximo and find “Hanging Idle” animation. We will be using this animation when we grab a ledge.
Download the animation and place it in the animation folder, in your project.
Click on the file in you project, and change the Animation Type to Humaoind.
Click on the Hanging Idle animation and press CTRL + D to duplicate the animation. After doing that, we can loop the animation and bake all the Poses.
Next, in the Animator controller add a new Trigger parameter called LedgeGrab.
Add the animation to you Animator Controller. Add a transition from Any state to Hanging Idle.
Add a condition to the transition.
Now we will create a box that our Character could grab. It will be our grab checker. Inside of the Player create a cube and call it Ledge_Grab_Checker. Change the scale to (0.1,0.1,1). Start the game, Trigger the Hanging animation in Animation Controller. Align the Ledge_Grab_Checker, with the animation.
If we exit the Playmode our Ledge_Grab_Checker won’t be saved, we need to create a Player prefab.
Create a new folder in your project called Prefabs, and add the Player to it. Exit the Playmode, delete your Player from the Hierarchy, and add the Player Prefab.