On this script there’s an Error I couldnt find it, but it says its on the last function OnGui
Please help me Thanks
Error: Expecting (, found ‘OnGUI’
‘;’ expected. Insert a semicolon at the end. (Line 114- 136)
PS; Its on Unity 4.7.2
#pragma strict
var rayLength : int = 10;
private var inventory : Inventory;
private var guiShow : boolean = false;
private var guiFish : boolean = false;
var bush : GameObject;
var player : GameObject;
function Start()
{
inventory = GameObject.Find(“First Person Controller”).GetComponent(Inventory);
}
function Update()
{
var hit : RaycastHit;
var fwd = transform.TransformDirection(Vector3.forward);
if(Physics.Raycast(transform.position, fwd, hit, rayLength))
{
if(hit.collider.gameObject.tag == "Wood")
{
guiShow = true;
if(Input.GetKeyDown("e"))
{
inventory.wood++;
Destroy(hit.collider.gameObject);
guiShow = false;
}
}
if(hit.collider.gameObject.tag == "Coconut")
{
guiShow = true;
if(Input.GetKeyDown("e"))
{
inventory.coconut++;
Destroy(hit.collider.gameObject);
guiShow = false;
}
}
if(hit.collider.gameObject.tag == "BushFull")
{
guiShow = true;
bush = (hit.collider.gameObject);
if(Input.GetKeyDown("e"))
{
bush.GetComponent(BushController).berriesTaken = true;
guiShow = false;
var p : float = Random.value;
if (p>0.01) player.GetComponent(Inventory).berry += 5;
if (p>0.6) player.GetComponent(Inventory).berry += 5;
if (p>0.85) player.GetComponent(Inventory).berry += 5;
}
}
if (hit.collider.gameObject.tag == "Campfire")
{
guiFish = true;
if (Input.GetKeyDown ("e") && player.GetComponent(Inventory).fish >= 1)
{
player.GetComponent (Inventory).cookedfish ++;
player.GetComponent (Inventory).fish --;
}
if (hit.collider.gameObject.tag == "Campfire")
{
if (Input.GetKeyDown ("e") && player.GetComponent(Inventory).meat >= 1)
{
player.GetComponent (Inventory).cookedmeat ++;
player.GetComponent (Inventory).meat --;
}
else
{
//NOT Enough Fish
Debug.Log("Not enough fish");
}
}
if(hit.collider.gameObject.tag == "Rock")
{
guiShow = true;
if(Input.GetKeyDown("e"))
{
inventory.stone++;
Destroy(hit.collider.gameObject);
guiShow = false;
}
}
}
if(hit.collider.gameObject.tag == "Fish")
{
guiShow = true;
if(Input.GetKeyDown("e"))
{
inventory.fish++;
Destroy(hit.collider.gameObject);
guiShow = false;
}
}
else
{
guiShow = false;
guiFish = false;
}
}
function OnGUI();
{
if(guiShow == true)
{
GUI.Box(Rect(Screen.width / 2 - 150, Screen.height / 2 - 150, 100, 20), “PICKUP!”);
}
if(guiFish == true)
{
GUI.Box(Rect(Screen.width / 2 - 150, Screen.height / 2- 150, 100, 20), "Cook Fish!");
}
}