void Start () { mainScript = this.gameObject.transform.root.GetComponent<BackgroundCollisions> (); myPosition = this.gameObject.transform.position; rt = GetComponent<RectTransform> (); //Accessing the RectTransform of the object, used to modify width and height values camera = gameCamera.GetComponent<Camera> (); //Getting game Camera screenPos = camera.WorldToScreenPoint (myPosition); //Declaring objects position on screen based off its transform in the scene // height = Screen.height; height = 490; }
void Start() { mainScript = this.gameObject.transform.root.GetComponent<BackgroundCollisions> (); rt = GetComponent<RectTransform> (); }