Question by
andystormglass · Feb 13, 2016 at 08:26 PM ·
javascripterror-messagebce0044uce0001bce0043
BCE0043, BCE0044 and UCE0001 errors after upgrade from 4.3 to 5.3
Noob request. I just upgraded an old game from Unity 4.3 to 5.3, and managed to fix most of the problems, but am stuck on three errors.
(73,82): BCE0043: Unexpected token: ).
(73,83): BCE0044: expecting ), found ';'.
(73,84): UCE0001: ';' expected. Insert a semicolon at the end.
Any advice or insight? Thanks!!
#pragma strict
var player : Transform;
var inventory : Transform;
var optimalDistance:float = 4.5f;
var tokenPink : GameObject;
var tokenBlue : GameObject;
var keyButton : GameObject;
var chocoButton : GameObject;
var casseteButton : GameObject;
var key : GameObject;
var cassete : GameObject;
var chocolate : GameObject;
var humSoundObj : GameObject;
var errorSoundObj : GameObject;
var keyDropSoundObj : GameObject;
var buttonPressSoundObj : GameObject;
var casseteDropSoundObj : GameObject;
var chocoBarDropSoundObj : GameObject;
var chocolateEatingSoundObj : GameObject;
var insertedTokenCount : int = 0;
public var keySoldCount : int = 0;
public var casseteSoldCount : int = 0;
private var chocolateSoldCount : int = 0;
var keyDropAnim : AnimationClip;
var casseteDropAnim : AnimationClip;
var chocolateDropAnim : AnimationClip;
private var tokenMessage : String = 'Enter Token';
private var soldMessage : String = 'Sold Out';
var tm : TextMesh;
private var display : String = "";
var displayError : boolean = true;
var circuitPuzzle : GameObject;
private var circuitPuzzleScript : BreakRoomCircuitPuzzle;
//Chocolate eating effects
var cameraObj : GameObject;
private var message : String = '';
private var displayMessage : boolean = false;
var textInfo:GUIContent;
var textStyle:GUIStyle;
private var choclatyMessage : String[] = [ "I haven't felt that good since Archie Gemmill scored against Holland in 1978!",
"I am Cornholio!",
"I can't stop here. This is bat country.",
"Aloha, Mister Hand!",
"Looks like I picked the wrong week to quit VindiqoQos.",
"Snootchie Bootchies!!!",
"Groovy!",
"Excellent.",
"Bodacious.",
"It's showtime.",
"I think I just froze the left half of my brain!",
"Look! I can't move my right arm!",
"It's a Kafka rush. I feel like a bug."
];
function Start () {
if(gameObject.FindWithTag("Player")) {
player = gameObject.FindWithTag("Player").transform;
}
circuitPuzzleScript = circuitPuzzle.GetComponent<BreakRoomCircuitPuzzle>();
}
function Update () {
if(!circuitPuzzleScript.isCircuitPuzzleSolved){
return;
}
if(!Camera.main && !player) {
return;
}
if(!humSoundObj.audio.isPlaying){
humSoundObj.audio.Play();
}
var distPlayer: float = Vector3.Distance(player.position, this.transform.position);
if (distPlayer >= optimalDistance) {
return;
}
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended) {
var hit : RaycastHit;
var ray = Camera.main.GetComponent(Camera).ScreenPointToRay (Input.GetTouch(0).position);
if (Physics.Raycast (ray, hit)) {
if ((hit.transform.name == chocoButton.name) || (hit.transform.name == casseteButton.name) || (hit.transform.name == keyButton.name)){
buttonPressSoundObj.audio.Play();
if (hit.transform.name == chocoButton.name){
if(chocolateSoldCount < 300){ //300 is subsititude of unlimited
if(insertedTokenCount >= 1){
chocolateSoldCount++;
insertedTokenCount--;
displayError = false;
DropItem(chocolate, chocolateDropAnim, chocoBarDropSoundObj);
} else {
DisplayMessage(tokenMessage);
}
} else {
DisplayMessage(soldMessage);
}
}
if (hit.transform.name == casseteButton.name){
if(casseteSoldCount < 1){
if(insertedTokenCount >= 2){
casseteSoldCount++;
insertedTokenCount -= 2;
displayError = false;
DropItem(cassete, casseteDropAnim, casseteDropSoundObj);
} else {
DisplayMessage(tokenMessage);
}
} else {
DisplayMessage(soldMessage);
}
}
if (hit.transform.name == keyButton.name){
if(keySoldCount < 1){
if(insertedTokenCount >= 1){
keySoldCount++;
insertedTokenCount--;
displayError = false;
DropItem(key, keyDropAnim, keyDropSoundObj);
} else {
DisplayMessage(tokenMessage);
}
} else {
DisplayMessage(soldMessage);
}
}
}
if (hit.transform.name == 'Chocolate(Clone)'){
Destroy(hit.transform.gameObject);
chocolatyMessageDisplay();
chocolateEatingSoundObj.audio.Play();
iTween.ShakePosition(cameraObj, new Vector3(1,1,0), 2);
iTween.ShakeRotation(cameraObj, new Vector3(1,1,0), 2);
}
}
}
if(!displayError) {
tm.text = insertedTokenCount.ToString() + " Tokens";
}
}
function OnGUI() {
if(displayMessage) {
// var centeredStyle = GUI.skin.GetStyle("Label");
// centeredStyle.alignment = TextAnchor.UpperCenter;
// centeredStyle.fontSize = Screen.width/30;
// GUI.Label(Rect(0, Screen.height / 6, Screen.width, Screen.height), message, centeredStyle);
var width:int = 0.78 * Screen.width;
var height:int = 0.12 * Screen.height;
var tposx:int = (Screen.width - width)/2;
var tposy:int = (Screen.height - height)/2;
textInfo.text = message;
textStyle.fontSize = 0.04 * Screen.height;
GUI.Label(Rect(tposx, tposy, width, height), textInfo, textStyle);
}
}
function DropItem(vmItem : GameObject, vmItemDrop : AnimationClip, vmAudioObj : GameObject){
var newVendingItem : GameObject;
newVendingItem = Instantiate(vmItem);
newVendingItem.animation.Play(vmItemDrop.name);
vmAudioObj.audio.Play();
}
function DisplayMessage(msg : String){
displayError = true;
tm.text = msg;
}
function chocolatyMessageDisplay(){
var index : int = 0;
index = Random.Range(1, choclatyMessage.Length);
message = choclatyMessage[index];
displayMessage = true;
yield WaitForSeconds(2.5);
displayMessage = false;
}
Comment
Were you able to solve this problem? I'm having similar issues.