Tutorial 2 - Walking in Unity


Walking in Unity

For this tutorial work, the N64 man was brought into Unity and given the ability to wander around the existing scene. This involved hooking him up to a basic movement script which fittingly plays like PS1-era Resident Evil, where A and D will rotate the character and W will walk in the direction he's facing.


Pressing spacebar will make him celebrate. Here he is unable to find anything worth celebrating, but celebrates anyway. We can all learn something from him.


A small detail here is that his walking animation synchronizes with his movement speed. This was achieved by calculating his velocity using his position on the current frame minus his position one frame earlier (divided by time-since-last-frame for consistency), and feeding the velocity value to the walking animation speed "multiplier."


The animation's default speed was 1, but once the velocity became part of the equation by ticking the "Parameter" box (essentially saying "I want to put a variable here instead of a fixed number"), 1 was too fast. After some tuning, 0.15 looked good and the result is a natural walking pace that gradually stops as the character's movement slows.

From there you can just give him 11 coffees and his legs will accurately depict an 11 or even 12 coffee walk cycle.



The doorway behind him opens up because he enters a trigger, which is an invisible box in the game world that watches for anything passing through it, like a motion sensor. When the trigger detects the player it begins an event where it tells the door to become inactive, which makes it vanish. In this case the trigger is as tall as the player and as wide as the doorway itself, and sits in front of the door.

Here are two bugs in the character. I call them the Celebration Gliding feature and the Moonwalking feature.


Leave a comment

Log in with itch.io to leave a comment.