It show
“InternalGetTransform can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.”
This is my Code.
var Wandell : GameObject;
var Albert : GameObject;
var Alvis : GameObject;
var scale : Vector3 = transform.localScale;
function OnTriggerEnter(Player : Collider){
if(Player.gameObject == Wandell || Albert || Alvis){
scale.x=1;
scale.y=1;
scale.z = 0.1f;
Wandell.transform.localScale = scale;
if(Wandell.transform.localScale == scale){
yield WaitForSeconds(5);
scale.z = 1f;
Wandell.transform.localScale = scale;
}
}
}
Would anybody know how to fix this problem? Plz,thanks for the help ![]()