so I got a Button, which has two TextMeshPro and an image. I want to change the text of the one TextMeshPro, but I can’t get it in the code. I tried the following, but it didn’t work:

button.GetComponentInChildren(typeof(TextMeshPro)) as TextMeshPro
button.GetComponent()
also with Text, TextMesh as Properties for the GetComponent, but also no success. I also tried to get it form the Component with a script but it always says that it is null. Can someone help?
,I got a button, which has two TextMeshPro Items and an image. I can get the button from the panel. Now I want to change the text in the amount TextMeshPro, but it is always null,
I can get the amount Rect Transform with
button.Find(“Amount”)
But I can’t add
.GetComponent()
to get the text. I also tried
GetComponentInChildren()
but that also doesn’t work. Has some an idea who I can change the text?
I also tried to get it within the Gameobject ‘amount’ itself, but there is the same problem…