Question by
ohParallel · Jul 06, 2016 at 09:15 AM ·
1st person
HELP!? Assets/Scripts/PlayerGUI.js(5,25): UCE0001: ';' expected. Insert a semicolon at the end.
I am trying to make a FPS game by following a youtube tutorial. I have changed my controller script to unity 5 version but I keep getting semi colon error even though I have added them. Can anyone help?
#pragma strict
//Size Of Textures
var size : Vector2 = New Vector2(180, 20);
//Health Varibles
var healthPos : Vector2 = New Vector2(20, 20);
var healthBar : float = 1;
var healthBarEmpty : Texture2D;
var healthBarFull : Texture2D;
//Hunger Varibles
var hungerPos : Vector2 = New Vector2(20, 60);
var hungerBar : float = 1;
var hungerBarEmpty : Texture2D;
var hungerBarFull : Texture2D;
//Thirst Varibles
var thirstPos : Vector2 = New Vector2(20, 100);
var thirstBar : float = 1;
var thirstBarEmpty : Texture2D;
var thirstBarFull : Texture2D;
//Stamina Varibles
var staminaPos : Vector2 = New Vector2(20, 140);
var staminatBar : float = 1;
var staminaBarEmpty : Texture2D;
var staminaBarFull : Texture2D;
//Fall Rate
var healthFullRate : int = 150;
var hungerFullRate : int = 150;
var thirstFullRate : int = 100;
var staminaFullRate : int = 35;
private var chMotor : UnityStandardAssets.Characters.FirstPerson.Prefabs.FPSController;
private var controller : CharacterController;
var canJump : boolean = false;
var jumpTimer : float = 0.7;
function start()
{
chMotor = GetComponent(CharacterMotor);
controller = GetComponent(CharacterController);
}
function OnGUI()
{
//HealthGUI
GUI.BeginGroup(new Rect (healthPs.x, healthPos,y, size.x, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), healthBarEmpty);
GUI.BeginGroup(Rect (0, 0, size.x * healthBarDisplay, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), healthBarFull);
GUI.EndGroup();
GUI.EndGroup();
//HungerGUI
GUI.BeginGroup(new Rect (hungerPs.x, hungerPos,y, size.x, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), hungerBarEmpty);
GUI.BeginGroup(Rect (0, 0, size.x * hungerBarDisplay, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), hungerBarFull);
GUI.EndGroup();
GUI.EndGroup();
//ThirstGUI
GUI.BeginGroup(new Rect (thirstPs.x, thirstPos,y, size.x, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), thirstBarEmpty);
GUI.BeginGroup(Rect (0, 0, size.x * thirstBarDisplay, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), thirstBarFull);
GUI.EndGroup();
GUI.EndGroup();
//StaminaGUI
GUI.BeginGroup(new Rect (staminaPs.x, staminaPos,y, size.x, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), staminaBarEmpty);
GUI.BeginGroup(Rect (0, 0, size.x * staminaBarDisplay, size.y));
GUI.Box(Rect(0, 0, size.x, size.y), staminaBarFull);
GUI.EndGroup();
GUI.EndGroup();
}
Comment
Your answer
Follow this Question
Related Questions
Licenses Question 1 Answer
如何使用Unity自带的OpenFileDialog开启Edit中OpenScene一样的Windows窗体 0 Answers
Need Help with char controller and animation 0 Answers
Jump not working 0 Answers
Help please. I have a problem with Error CS0120. C# 1 Answer