#This is in javascript. Please do not give an answer in C#.
I am having trouble with this code to get an achievement. I have tried quite a lot and looked at other questions and nothing works. it give me the following errors with the following scripts.
Errors for script “displayAchievement”:
Unknown Identifier: ‘texName’.
Unknown Identifier: ‘give’.
Script “display achievement”: (attached to “Achievement” gameobject)
#pragma strict
function Start () {
}
function Update () {
}
function Awake ()
{
var reciever_obj = GameObject.Find("achivementReciever");
var script = reciever_obj.GetComponent(detectAchievement);
var texNameRecieved = script.GetComponent(texName);
var getAchivement = script.GetComponent(give);
if ( getAchivement == true )
{
GameObject.Find("Achievement").guiTexture.texture = texNameRecieved;
guiTexture.enabled = true;
}
}
My other script has no errors.
Script name: detectAchievement
Attached to: achievementReciever
Script:
#pragma strict
function Start () {
}
function Update () {
}
var texName : Texture;
var give : boolean = false;
I don’t get why it errors. PLEASE HELP!
Thank you! It works!
– Tpaley