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.
PORTFOLIO - KIT207
More posts
- Devlog 5.5: Making Things Look Pretty :) (unfinished)Apr 14, 2024
- Devlog 5: Let There Be Light (And Shaders)!Apr 12, 2024
- Devlog 4.5: Game IdeationApr 12, 2024
- Devlog 4: We Make A Lil Game (unfinished)Apr 12, 2024
- Devlog 3.5: Meshy MeshesMar 21, 2024
- Devlog 3: Becoming A Pro BuilderMar 21, 2024
- Devlog 2: Rigged (From The Start...?)Mar 15, 2024
- Devlog 1.5: Making A Scene!Mar 10, 2024
- Devlog 1: Gabbitt's Barrel (And Friends)Mar 06, 2024
Leave a comment
Log in with itch.io to leave a comment.