I have a GameObject with a UI text element and a content size fitter attached. It seems that once it is attached you can no longer retrieve the width/height of the recttransform of the object in script. Neither method I know works. They all return 0.
gameObject.GetComponent().rect.size
gameObject.GetComponent().rect.height
gameObject.GetComponent().sizeDelta
Does anybody know a way to still get these values?