Hi,
I tried the following code on update(),
convertedVector=GameObject.FindGameObjectWithTag("camera").GetComponent<Camera>().ScreenToWorldPoint(new Vector3(Input.mousePosition.x,Input.mousePosition.y,camera.nearClipPlane+10.0f));
But unity is giving me a error like this,
MissingComponentException: There is no 'Camera' attached to the "whatTheFuck" game object, but a script is trying to access it.
You probably need to add a Camera to the game object "whatTheFuck". Or your script needs to check if the component is attached before using it.
gameobjtest.Update () (at Assets/scripts/gameobjtest.cs:15)
camera is attached to a gameobject tagged “camera” and the refering script is attached to a gameobject called “whatTheFuck”. Now I am not trying to access any camera attached to “whatTheFuck” gameobject, rather I am trying to access camera from another gameobject. But unity is saying me electric. What is causing the problem?