The UnityUI Image component isn’t derived from Monobehaviour, Component nor is it an interface, how do I access it in my scripts then? I tried .GetComponent, but it tells me it cant do that because of the statement above ![]()
ArgumentException: GetComponent requires that the requested component 'Image' derives from MonoBehaviour or Component or is an interface.
UnityEngine.GameObject.GetComponent[T] () (at <05f2ac9c8847426992765a22ef6d94ca>:0)
GUIController.Start () (at Assets/UI/Scripts/GUIController.cs:41)
The code I use:
Image menueImage1 = menueButton1.transform.Find("Cap").gameObject.GetComponent<Image>();
Unity Version: 2019.3.10f1
Location of ‘component’ in local Docs: Unity/2019.3.10f1/Editor/Data/Documentation/en/Manual/script-Image.html
I attached a picture of the ‘component’.
