// Use this for initialization void Start() { parentScript = GetComponentInParent<BlackHoleScript>(); collider = gameObject.GetComponent<Collider>(); active = parentScript.IsActive(); collider.enabled = active; }
// Use this for initialization void Start() { parentScript = GetComponentInParent <BlackHoleScript>(); collider = gameObject.GetComponent <Collider>(); active = parentScript.IsActive(); collider.enabled = active; }
// Update is called once per frame void Update() { active = parentScript.IsActive(); collider.enabled = active; }