I am trying to access any parameters on a UI-Button, but they are being highlighted red in the script and I get Errormessages altough I have “using UnityEngine.UI;” implemented in my script.
Example Error: “…Type Button' does not contain a definition for interactable’ and no extension method interactable' of type Button’ could be found (are you missing a using directive or an assembly reference?)”
My script simplified:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class MyScript: MonoBehaviour {
public Transform tButton;
void SetButtons()
{
if(blabla)
{
Transform newButton = Instantiate(tButton, tButton.transform.position + v3NewButtonPosiOffset(), Quaternion.identity) as Transform; //some buttons will be instantiated aside each other
}
}
}