I know many of members have asked this question, I have tried to apply their solutions but they are not working for me. I have an object with this script :
function OnCollisionEnter (col : Collision) {
if (col. gameObject.name == "Player"){
var go = GameObject.Find("Player");
go.GetComponent(testToAdd).add();
print("You have the key");
Destroy(gameObject);
}
}
When Player hits the object, object gets destroyed and calls a function “add” in script “testToAdd.js”, whitch is attached to Player. I’m using Unity 3.2 Pro Trial and try to build game on iPad, when receive the error from topic…