- Home /
Question by
VLunarFangV · Jun 24, 2014 at 05:33 PM ·
javascriptvarbce0019
"x" is not a member of 'function(): void'.
So I need to get a variable from another script but I have no idea how it is done. Every time I try, I get ""location" is not a member of 'function(): void'."
private var navMeshAgent : NavMeshAgent;
var target : Transform;
function Start () {
target=Main.location;
navMeshAgent=GetComponent(NavMeshAgent);
}
This problem has been bothering me for weeks and I still have no solution. What am I doing wrong?
Comment
You would have to show your '$$anonymous$$ain' class as well. If you'd like to obtain a variable like you do ($$anonymous$$ain.anything) you have to make sure the variable is public and static.
Your answer
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Import Variables from another active script 1 Answer
Javascript class function is not a member of the class. BCE0019 0 Answers
see vars in gui 3 Answers
dropdown menu error 1 Answer