Devlog 2.5: Let's Get Animated!


The activity for this weekend included importing our modeled character (as provided by KIT207), along with their animations, into our Unity scene. These animations are conveniently imported as ready animation clips in Unity (such a smart program, I always say), which we can then trigger a game character to perform by setting conditions in the form of triggers and key inputs. All of this can be achieved using an animation controller, to set various animations and transitions, and their respective conditions.

In my scene, the character successfully waves when pressing [Spacebar]. In the animation controller, the wave is set as a trigger, waiting to happen, while in a script, we set this trigger to occur when the [Spacebar] is pushed (Input.GetKeydown). When not waving, the character returns (transitions) to its idle animation, where [Spacebar] can be pushed again to achieve a wave.


Push the button to wave!

For the second exercise, we completed a similar task wherein the character would move - sliding across the area - when the WASD keys are pushed. The character would rotate when A (left) or D (right) are pressed. Then, the main challenge of this task - triggering the walking animation when the character is moving. This would be done in a very similar manner; setting up a walking trigger, setting up the transitions from "walking" to "idling", and vice versa. 

The main difficulty was in the scripting. I had to create a boolean to detect for walking (true/false) and then ensure that the "walking" trigger goes off when [W] is pushed (walking = true), animating the character appropriately. Then, if the character is stopped (walking = false), they go back to idling.


The character turns with [D], and walking forward with [W]. Forgive me for the frames!

I am excited to apply these methods to my own modeled character; it will be so humbling to see them come to life. Thank you :)

Leave a comment

Log in with itch.io to leave a comment.