The player changes its color after passing through every wall. If the player is Yellow and the wall is Red then, the color of the player becomes orange. Also the next wall will be spawned with a little orange part. However, I could not turn on and off the orange wall object. The code below changes the players color and also changes the wall's color. However I could not make it acitve the wall (Which is deployBlack) and after passing through it deactivating it. Here is my code :
if(col.tag!= currentColor){
if (currentColor=="Yellow" && col.tag=="Red"){
sr.color=colorOrange;
currentColor="Orange";
deployBlack.SetActive(true);
whitesr.color=colorOrange;
deployBlack.SetActive(false);
}