**Basically i have a bool called switch that i’m getting from another script and i want a platform to be set as inactive when the bool is true, and active when the bool is false. i can get it to go inactive but i cant get it back to active. hope you guys can help help me out its doing my head in! i had a similar thing working with layer collisions but i think this is the better way to go
here’s my code: **
using UnityEngine;
using System.Collections;
public class SwitchBlue : MonoBehaviour {
public GameObject player;
private ActionManager Manager;
// Use this for initialization
void Start () {
Manager = player.GetComponent<ActionManager>();
}
// Update is called once per frame
void Update () {
if (Manager.Switch == false)
{
gameObject.SetActive (true);
}
else if (Manager.Switch == true)
{
gameObject.SetActive(false);
}
}
}
thanks guys!