Week 10:
Learning How To Use Unity Engine – Part 4:
Now that I have Enemy NPC, I now need to animate them and have them move around. In “Scenes”, I then created a new folder that I named “Animation” and in there I created a new “Animation Controller” that I then named “Zombie Animator”.
I then went into “Animator” and in the folders I went into “Zombie”, and then “Animation”. I then dragged the following “Animations” into the “Animator” section; “Idle”, “Walk”, “Attack” and “Fallingback”. Then in the “Parameters”, with the “+” button I then created four “Bools” I named “IsIdle”, “isWalk”, ”isAttack” and finally ”isFalling”. I also made sure to tick the “isIdle” bool.
In the “Base Layer”, I then selected “Idle” and right-clicked “Make Transition” to attach it to “Entry”. Afterwards, I then attached “Idle” to “Walk” and back again, then “Idle” to “Attack” and back again, then “Walk” to “Attack” and back again, and finally “Attack” to “Fallingback” then back again.
Then in “Idle” to “Walk”, I set the conditions of “isIdle” and “isWalk” to true. In “Idle” to “Walk”, I set the conditions of “isIdle” and “isAttack” to true. In “Walk” to “Attack”, I set the conditions of “isAttack” and “isWalk” to true. And finally, in the “Attack” to “Fallingback” I set the conditions of “isFalling” and “isAttack” to true. (Though, the latter part won’t technically be used).
Finally, in the “Inspector” in “Zombie” I scrolled down to “Animator” and made set the “Controller” to “Zombie Animator”.




No comments:
Post a Comment