public void raisePins() { foreach (Pin Pinn in GameObject.FindObjectsOfType <Pin>()) { if (Pinn.isStillStanding()) { Pinn.GetComponent <Rigidbody>().useGravity = false; Pinn.GetComponent <Rigidbody>().freezeRotation = true; Pinn.transform.Translate(new Vector3(0, 50, 0), Space.World); } } }
public void lowerPins() { print("LOWER_STARTED!"); foreach (Pin Pinn in GameObject.FindObjectsOfType <Pin>()) { if (!Pinn.isStillStanding()) { Destroy(Pinn.gameObject); } else if (Pinn.isStillStanding()) { Pinn.transform.Translate(new Vector3(0, -49, 0), Space.World); Pinn.GetComponent <Rigidbody>().freezeRotation = false; Pinn.GetComponent <Rigidbody>().useGravity = true; print("LOWERDED!"); } } }