Accessing grayed out height value of RectTransform Child giving only zero value?

Warning: Novice User

All I want is to get a float value from a RectTransform for height from a child gameObject. What is happening is when I try to get that value it says it is zero, but in the inspector it is not zero. I notice in the inspector it is grayed out. There must be a way I can get access to the actual value? I clearly do not understand what is going on.

My Guess:

Another Component is somehow making it zero when I check it?
RectTransform is doing something because of hierarchy (Parent Child Relationship)?

Hierarchy Layout



- TextMessage

--_ Container

--- Text

--_ Stretch

Notable Components

TextMessage → Horizontal Layout Group (Script)

Container → Vertical Layout Group (Script)

Inspector Behavior

TextMessage, RecttTransform Width and Height NOT grayed (Not Accessable in Inspector Window
Container, RectTransform Width and Height ARE grayed out.

Debug Log Test

TextMessage Code:


Output: 0

Inspector Value: 26 (Grayed Out)

Since old question ths is in reply to @a-t-hellboy