Okay so I've built my game to an Alpha state and when I try to build it I get this.
I know I've asked a lot of questions here lately but I get this error when I try to build my game.
Assets/Scripts/CoinPickup.js(11,13): BCE0005: Unknown identifier: 'UnityEditor'.
My guess would be since im building the game it no longer compiles scripts through the editor so something like if (UnityGame.TakeInfo)(name) == "Player";{ instead of UnityEditor perhaps? I'm officially stumped on this one.
Here's the script it says their a compiler error in.
pragma strict
//This Script gives the GUI info.
// This script also says if player collideds with coin then coin is destroyed
//Destroy effect prevents particles from being alive forever.
var CoinEffect : Transform;
var coinValue = 0;
function OnTriggerEnter (info : Collider){
if (UnityEditor.TakeInfo)(name) == "Player";{
GameMaster.currentScore += 1;
var effect = Instantiate(CoinEffect, transform.position, transform.rotation);
Destroy(effect.gameObject, 3);
Destroy(gameObject);
}
}
Answer by trallaton · Nov 05, 2015 at 03:45 AM
Fixed it! I just needed to change it from if (UnityEditor.TakeInfo)(name) == "Player";{ if (info.tag == "Player")
Your answer
![](https://koobas.hobune.stream/wayback/20220612043846im_/https://answers.unity.com/themes/thub/images/avi.jpg)