//Gameobject has to be active (Displayed) //otherwise it will return the value from the last active frame (0)! Canvas.ForceUpdateCanvases(); [Your Text Compontent].cachedTextGenerator.lineCount;