Posted March 21, 2024 by JonoG
Firstly, I imported the character I created in the self-study. I initially imported the .blend file into unity, which didn't carry over the animations with the model. I then tried importing the project as a .fbx file, which did import the animations.
I followed the instructions in the tutorial to get the following movement:
Once again following the instructions on the tutorial page, I created the door that opens when the player collides with the trigger detection box.
I then began working on the adding the walking animation to the scene. I created the transitions to the different animations. I used the animator.SetBool() function to change the animation, which was triggered when the input was pressed. The code for this is as follows:
var movement = Input.GetAxis("Vertical");
if (movement >= 1)
{
animator.SetBool("Walking", true);
animator.speed = 1.5f;
}
else
{
animator.SetBool("Walking", false);
}
This is what the final product looks like: