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
KIT207 Portfolio
More posts
- Tutorial 5 - Cinemachine and Post-ProcessingAug 17, 2022
- Module 5 - Lighting and ShaderGraphsAug 16, 2022
- Game ConceptsAug 09, 2022
- Module 4 - Simple Game MechanicsAug 07, 2022
- Tutorial 3 - NavMesh and AI PathingAug 07, 2022
- Module 3 - Terrain and ProBuilderAug 02, 2022
- Module 2 - Modelling and AnimationJul 26, 2022
- Tutorial 1 - Simple SceneJul 20, 2022
- Module 1 - ModellingJul 19, 2022
Leave a comment
Log in with itch.io to leave a comment.