I am working with the Google Cardboard plugin in Unity 3D (version 5.3.2). I have a C# script set up that is supposed to access the variable "target" from the script "GvrHead.cs". This is the part of the script (it is called "CrystalDrop.cs"):
12. public Transform target2;
13. private GameObject HeadObj;
14. private GvrHead myScript;
15.
16.
17. void Start () {
18. HeadObj = GameObject.Find ("GvrHeadObj");
19. myScript = HeadObj.GetComponent(GvrHead);
20. myScript.target = target2;
21. }
But when I run the project in Unity, I get this error:
Assets/CrystalDrop.cs(19,49): error CS0119: Expression denotes a type
, where a variable
, value
or method group
was expected.
Does anybody know what is going on?