I want to attach an object to my screen. (like object stays always in the center of the screen) I have one camera. I am currently not moving the, but I can’t position my object in the right place. Here is what i do:
void Start (){
//Find the camera
go=GameObject.Find("ARCamera");
// transform screen position to world position
Vector3 vector = new Vector3 (0, 0, 20);
Vector3 p = go.camera.ViewportToWorldPoint(vector);
//transform the object
transform.Translate(p,Space.World);
}