Good evening everyone, my English is not good. I need your help. I have a problem with my Script. I have 3 Game Objekts a Switch, blue barrier and a red barrier. When I press the switch, the blue barrier is aktiv and the red barrier not. When I press the switch again, the blue barrier is not aktiv and the red barrier is aktiv. I would like more barriers in my Scene. wenn i make tow GameObjects Arrays in my script. Is the Script not work. Switch Script: Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class RBSwitch : MonoBehaviour { private Animator anim; public GameObject[] redbox; public GameObject[] bluebox; // Start is called before the first frame update void Start() { //rotebox = GameObject.Find("/Rot/R_Box"); //blauebox = GameObject.Find("/B_Box"); //rotebox = GameObject.FindGameObjectsWithTag("switch_r"); //blauebox = GameObject.FindGameObjectsWithTag("switch_b"); anim = GetComponent<Animator>(); } // Update is called once per frame void Update() { } public void Smash() { if (anim.GetBool("rbonoff") == true) { anim.SetBool("rbonoff", false); redbox.GetComponent<rswitch>().switchred(); bluebox.GetComponent<bswitch>().switchblue(); } else { anim.SetBool("rbonoff", true); bluebox.GetComponent<bswitch>().switchblue(); redbox.GetComponent<rswitch>().switchred(); } } } Red Barrier Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class rswitch : MonoBehaviour { private Animator anim; // Start is called before the first frame update void Start() { anim = GetComponent<Animator>(); } public void switchred() { if (anim.GetBool("rswitch") == true) { anim.SetBool("rswitch", false); } else { anim.SetBool("rswitch", true); } } } Blue Barrier Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class bswitch : MonoBehaviour { private Animator anim; // Start is called before the first frame update void Start() { anim = GetComponent<Animator>(); } public void switchblue() { if (anim.GetBool("bshwitch") == true) { anim.SetBool("bshwitch", false); } else { anim.SetBool("bshwitch", true); } } } best regards