I’ve been attempting to put a script on a button for a while and it is resisting my efforts. I’m sure it’s something simple that I’m doing that’s causing the problem. Any help would be appreciated.
public class HelpText : MonoBehaviour
{
[TextArea]
[SerializeField] string helpText;
[SerializeField] TextMeshProUGUI contentText;
[SerializeField] GameObject helpTextScrollView;
[SerializeField] bool isVisible = true;
HelpText[] openHelpTexts;
RectTransform rectTransform;
private void Start()
{
rectTransform = helpTextScrollView.GetComponent<RectTransform>();
contentText.text = helpText;
}
The issue I run into is anything I assign in the editor is null on reaching the Start method. The object I’m putting the script on is a button.
I think I’ve been focused on the problem for so long that I can’t see something obvious. Again, thanks for any insight.