Tutorial 2


This tutorial was about animating a 3D model in Unity using Unity's Animation system and combining that with some basic motion control.

After importing the model into Unity,  we used Unity's Animation system to organise the animations for the model.  This allows us to make conditions for transitioning into or between animations, which can be effected through code. Using very basic code, we made the model go through its waving animation by pressing SPACE.


To be able to move our model around, we used some more basic code to gain the user input and a CharacterController component upon which to apply the calculated velocity. 

We then set the walking animation to trigger when the model was moving with a Boolean parameter. Because the measured speed would randomly spike while the model was stationary and trigger the animation, a small timer delay was added. The measured speed was used to vary the speed of the animation when walking.

 

Unity Events is a feature that allows you to manage model interaction more directly through the engine instead of via code. We used this to make a ‘door’ disappear when the model moved in front of it.