- Home /
Question by
CyDevDevon · Feb 19, 2012 at 01:16 AM ·
errorgetcomponent3.5
GetComponent Editing Variables not working in 3.5?
So I have been working with 3.4 for a long time while waiting with 3.5. But when I transfer my scripts it says GetComponent("Script2").bool; is not a member of 'UnityEngine.Component'. In 3.4 I would never get this problem any tips/ways of fixing it?
CODE: Script 1:
var boolA = true;
function Update(){
var boolE = transform.GetComponent("Script2").bool;
boolE = boolA;
}
Script 2:
var bool = true;
function Update() {
}
PS: Both scripts are on the same gameObject so I used transform for a default way of finding the script.
Comment
Try using the generic variant of GetComponent. 3.5's UnityScript is a bit more strict about types than previous versions.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
CS8025 Parser error 2 Answers
Disable a GameObjects scripts knowing only the GameObjects name 3 Answers
Invalid Characters in Path 1 Answer