My journey becoming a Unity game developer: 2.5D Infinite Runner-Idle, Running, and Running Jump animations Pt.1
Objective: Create Idle, Running, and Running Jump animations. Also, setting them up to be used by the Player object.
We need to download a couple of animations for our Player. To start, we will download an Idle animation from a great website name Mixamo by Adobe. All the animations are free to download and use in video games, cutscenes, animation movies, and more. You must create a free account with Adobe to access these animations for your use.
Search for Idle animations and pick one you prefer. Click on Download and select the following:
Format- FBX for Unity
Frames per second: 30
Skin: with Skin (without Skin, your model will have to supply the skin for the animation)
Keyframe Reduction: none
Once you have those settings, click on Download.
Once the Idle animation is downloaded, drag the animation into the Assets folder inside a new folder created name FBX to hold all of the original Mixamo animations. Select the Idle animation, go to Rig, change Animation Type from Generic to Humanoid, Avatar Definition we will keep the Create From This Model, and select Apply. This will set the bones of the animation’s rig to be animated like a human.
Then, go to the Idle animation clip itself which is a Triangular shape icon and duplicate it. Create a new Animations folder inside of the Player’s Model folder to keep it organized with that character. Drag the duplicate Idle animation clip into the Animations folder, and rename it to simply Idle.
Under the Player object, change the name of the child model object to Model. Inside of the same Animations folder, create an Animator Controller and name it Player_Animator. Drag this controller into the Controller slot under Animator component attached to the Model object. Double-click on the Controller’s slot to open the Player_Animator. Drag the Idle animation from the Animations folder into the Animator.
Back in the Animations folder, select the Idle animation clip and turn on Loop Time just to test out the clip.
When we press Play, the Idle animation will play over and over.
Download a Running animation the same way we did the Idle animation. The one thing we must do for this animation is turn on the In Place setting. This will make the animating character stay in place while running.
Drag the Running animation into the FBX folder, make sure to change it from Generic to Humanoid and Apply.
Duplicate the Running animation clip and drag it into the Animations folder. Rename it to Running and turn on Loop Time.
Place the Running animation clip in the Animator, and transition from Idle to Running. Press Play and watch it go from Idle to Running.
Download a Running Jump animation, drag it into the FBX folder, change from Generic to Humanoid, duplicate the Running Jump animation clip, place it into the Animations folder, and turn on Loop Time.
Place the Running Jump animation clip into the Animator. Right-click on it and select Set as Layer Default State. Press Play and watch the Running Jump animation working.
Notice the Player animation running off the screen. That happened because the Root Motion has control over the animation. In the Animator component under the Model object, make sure to turn off the Apply Root Motion setting to give us control over the animation itself. Press Play to see the Player Running Jump in position.
Next time we will set up the transitions between the animations.