Can anyone tell me why i get this error? “Assets/Scripts/PlayerGUI.js(30,23): BCE0018: The name ‘CharacterMotor’ does not denote a valid type (‘not found’).”
#pragma strict
var size : Vector2 = new Vector2(240, 40);
var healthPos : Vector2 = new Vector2(20, 20);
var heathBarDisplay : float = 1;
var healthBarEmpty : Texture2D;
var healthBarFull : Texture2D;
var hungerPos : Vector2 = new Vector2(20, 60);
var hungerBarDisplay : float = 1;
var hungerBarEmpty : Texture2D;
var hungerBarFull : Texture2D;
var thirstPos : Vector2 = new Vector2(20, 100);
var thirstBarDisplay : float = 1;
var thirstBarEmpty : Texture2D;
var thirstBarFull : Texture2D;
var staminaPos : Vector2 = new Vector2(20, 140);
var staminaBarDisplay : float = 1;
var staminaBarEmpty : Texture2D;
var staminaBarFull : Texture2D;
var healthFallRate : int = 150;
var hungerFallRate : int = 150;
var thirstFallRate : int = 100;
var staminaFallRate : int = 35;
private var chMotor : CharacterMotor;
private var controller : CharacterController;
var canjump : boolean = false;
var jumpTimer : float = 0.7;
function Start() {
chMotor = GetComponent(CharacterMotor);
controller= GetComponent(CharacterController);
}
function OnGUI() {
GUI.BeginGroup(new Rect(healthPos.x, healthPos.y, size.x, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), healthBarEmpty);
}