// Update is called once per frame void Update() { if (Application.loadedLevelName == "Scene" || Application.loadedLevelName == "Tutorial") { attractor = GameObject.Find("Planet").GetComponent<FauxGravityAttractor>(); this.GetComponent<Rigidbody>().useGravity = false; attractor.attract (myTransform); } else { this.GetComponent<Rigidbody>().useGravity = true; } }