Tutorial 2 - Player Movement


Tutorial 2

For this tutorial we had to use the models we created in Unity. This wasn't to much of a challenge to do. Fortunately blender makes it easy to export the model and Unity is generally good at accepting creations from blender. The first thing I did was get the idle animation working and pace the character in the scene.

It's a bit stiff looking but it works well enough.



The next thing was to allow the player to wave. This is also simple to do, plus I've I learnt a lot about the animations controls unity provides last year. Animations exists in different "states" and these can be transitioned between. Unity allows a variety of ways to transition but for waving all that needs to be done is to check whether a button has been pressed and change the animation accordingly. In this case I made the space bar wave.

Here is the character waving


Next I added some movement controls to the player. There was some issues with how I'd done the model so that unity considered his right shoulder to be the front so the character sidestepped everywhere. This was an easy fix as the issue was that when I exported the character from blender it wasn't facing what is considered to be "forwards". I re-exported the character facing the right way and the problem was solved.

Basic movement, no walking animation yet


Next I set up a basic trigger, a door that disappears when the player approaches. This was a good refresher for how these types of triggers work. These types of triggers can be repurposed to do many useful things in Unity. They are also quite simple to implement, at least at this basic level.

Door test



Finally I made the character use the walking animation I made. This was basically the same as the wave control but instead of checking when a button is pressed it checks if it is held down (in this case checking 'W'). The animation is changed based on this. I also had to make the walking animation loop as well as make sure the transition between animations was fast. Unity allows for this to be done easily so no issues there. I also changed the speed of the walking animation to be a bit faster to make the character slide less. The animation itself is still a bit janky so it does look a bit weird still.

The final result


Leave a comment

Log in with itch.io to leave a comment.