Using Animation Parameters to Kick
Let’s delete the hip-hop animations and add in the Fight idle, MMA kick and the jump. Have fight idle be your starting transition.
Create a script called custom controls and place it on the player capsule. First, reference the starter assets.
The starter assets input will be where we grab the button presses and the first person controller executes based on those inputs. In our starter assets, we need to connect to a kick button. Let’s make a quick button in our starter assets input controller.
In our custom controls, we need to create a public bool to check if we are kicking and grab that input.
In our starter assets, let’s create a kick function that connects to our custom controls. This is where we will place all of our kick script.
To keep the bool from going on, set the bool to inactive after the press.
Now grab a reference to the animator.
Create a trigger and connect the animations from idle to kick.
In the idle, click on transitions and set it to only happen with kick is triggered with no exit time.
In your kick function, script out that whenever you press the kick button, you play the kick animation.