private var change: int = 0;
function Start () {
}
function Update () {
Debug.Log (change);
if(Input.GetButtonDown("Jump"))
{
if (change < 1)change ++;
else change = 0;
}
if (change == 0){
if(tag=="Black")renderer.enabled = false;
if(tag=="White")renderer.enabled = true;
}
if (change == 1)
{
if(tag=="Black")renderer.enabled = true;
if(tag=="White")renderer.enabled = false;
}
}
What I am trying to do is have a player switch between two different sets of platforms on the press of the space bar. The problem I have is the collider is still there when the platform render is off. What I think I need to do is turn the gameobjects on and off from a separate gameobject.