The Adventures of Tokk Project Report Raphael Leon 31 may 2014 | Page 6
}
By using GetComponent this tells unity that this script uses another script
that is elsewhere in the game. This script calls upon two other scripts,
Mskinventry and Mskinventry2 (there are two scripts because there are two
masks per level). These scripts have been placed on the masks that appear in the
top right corner that are only seen when an in game mask is destroyed by the
character. The in game masks have a script on them that destroys the mask when
it collides with the player. This script in turn calls upon the PlayerScript so that it
is able to change the “masks” value to one higher then previously and display the
mask in the top right corner. (These scripts can be seen and explained in the
videos supplied in my hand in.)
function Update() {
// calling upon Unity3D's character controller
var controller : CharacterController = GetComponent(CharacterController);
This is used to tell Unity3d that this script is being used as a Character
controller. GetComponent