I’m trying to access the .interactable property of my game object, but for some reason I can’t. I’ve made sure that I am using UnityEngine.UI and I believe my code to be correct.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class Toggle : MonoBehaviour {
public GameObject myToggle;
void Start () {
LargeBombTgl.GetComponent<Toggle> ().interactable = false;
}
}
When I try to access the .interactable property, no option is available in the monodevelop dropdown menu; the “interactable” text appears to be red. The same outcome is achieved when I change myToggle to type “Toggle” instead of GameObject.