KIT 207 tutorial 2 work: 3D models in Unity


For this week's tutorial, I added my character into Unity and made it walk. Not only that, but I also checked if the character was moving, to determine if the walking animation played or not.

Guy walking in Unity

Made by me in Unity, model made by me in Blender.

Door disappearing

Made by me in Unity, model made by me in Blender.

To do this, I added a Boolean into my animation controller that checks if the character is moving or not. Then, inside my character's control script, I had it check every frame to see if the character is moving on the vertical axis (that is, forwards and backwards). If it is, it sets the walking Boolean true, thus triggering the walking animation. If not, it's set to false, setting the animation back to idle.

A tricky part of this was to make sure the change from walking to idle, and vice versa, was instantaneous. To do this, inside the animation controller, I disabled the exit time for both transitions.

Leave a comment

Log in with itch.io to leave a comment.