Hello all,
Im new to scripting so I’m following a tutorial however I get the following error:
“SideTrigger.js(7,30): BCE0043: Unexpected token: …”
The tutorial I’m following is for an older version of Unity (I have 4.3 and I think the tutorial is for 3.x). I’ve read that the JS component of Unity has changed a bit since 3.x, so I’m guessing that’s why I get the error but I can’t seem to figure out a solution.
The error is for the line:
var dievalueComponent.currentValue=faceValue;
Below is the full script:
#pragma strict
public var faceValue = 0;
function OnTriggerEnter(other : Collider){
var dieGameObject=GameObject.Find("SixSidedDie");
var dieValueComponent=dieGameObject.GetComponent("DieValue");
var dievalueComponent.currentValue=faceValue;
Debug.Log(faceValue);
}
function Update () {
}