Tutorial 2


Tutorial 2's focus was implementing Self Study 2's model and animation from Blender. Straight away, I ran into an issue of the model facing the wrong way in Unity and I had to go back and export the model in Blender in a different direction which took a few tries. I only noticed this issue when I implemented the movement and my character was moving the wrong way!

(P.S. the colours in the gifs are a bit broken since I had to make the file size small enough for itch)



After I fixed that, I went onto adding the idle and wave animations to the character. This was pretty simple but it only played when the game started and the player had no control over it so I implemented a control so the player can press the Spacebar and after the idle animation completes, it will wave.



Additionally, I added a simple door mechanic using the Events system which allows separate objects to communicate between each other efficiently. While the door disappears, it is easy to implement a script that would make the door rotate instead. 



Then it was onto implementing the walking which was the hardest part. I wanted the walking animation to only play when the character is moving and then go to the idle animation when stopped. I had to implement some things in code such as finding the character's speed and then telling animation to move proportionally to that speed and then if the speed is 0, play the idle animation. It took some searching to find the right settings but I was able to get it to work in the end. I also made it so the animation played at the correct speed so it looked like the character was actually walking and not sliding across the ground with its legs out of sync.



A better example shown below shows the transitioning between the walking and idle animations. This is a feature of Unity's animation system which blends between animations and allows you to chose if an animation should play completely or it can be interrupted. It is hard to tell that the movement speed is proportional to the input as I was using a keyboard which only allows a 0 or 1 input where as a joystick would allow any value between 0 and 1 which would make it easy to see. Also the character model doesn't have any inertia so its speed goes from 100% to 0% instantly where as if it has physics, I could set it so it took some time to decelerate, making the walking animation slow down in the process.



Overall, I think the animations looked better in Unity probably because of the rendering and that having control over the character animation's and seeing it work was satisfying. I think the overexaggerated animations also matched the cartoony aesthetic that I had going on with Unity's default visual settings. Unity's animation system was also easier to work with than I expected yet show a lot of flexibility which would allow fluid looking animations if done well.

Leave a comment

Log in with itch.io to leave a comment.