Posted July 25, 2022 by xepries
A simple low poly tourist was created in blender using cubes that were ring cut and modified to become arms, legs, feet, hands, a head, a body and a pelvis.
This tourist was then textured, with features such as:
T posing tourist
This tourist was then rigged using armatures and weighted using the weight painting tool, which allowed him to be posed and animated easily.
Rigging was done for the tourists:
Once the tourist was rigged with armatures he was animated by inserting keyframes while posed into key poses, with Blender tweening the frames between key frames to create a smooth transition.
3 actions were created:
Tourist standing still and looking at tourist stuff
Tourist walking to view the next tourist thing
Tourist waving to his tourist friends, as he has found some tourist stuff to look at
These animations were imported into unity with the tourist and set up using the unity animator controller, as well as a character controller to allow the player to control the tourist.
The waving animation was set to trigger on a spacebar press, the walking animation triggering when the tourist moves, and idle set as the default animation.
Tourist in unity walking into a door and waving after he destroys it
The door was made by stretching a cube, and setting up a trigger collider in front of the door that detects the Player tag on the tourist, and disables the door.
A problem I ran into in this tutorial was using Update in code to compare the position of the tourist in the current frame compared to the previous frame, to work out the players speed for the walking animation. This caused the walking animation to constantly be running because the tourist was always moving for some reason. The fix for this was to use FixedUpdate to compare the positions.