Search Issue Tracker
By Design
Votes
0
Found in [Package]
Issue ID
1118137
Regression
No
Width and Height values in Rect Transform components change when GetComponent<TMP_Text>() is called in the Awake() function
How to reproduce:
1. Open attached Unity project
2. Load SampleScene scene
3. Select Canvas --> Text game object
4. Look at Rect Transform component. Width: 150, Height: 40
5. Enter the play mode
4. Look at Rect Transform component. Width: 200, Height: 50
Expected result: Width and Height values are the same when play mode is turned on or off.
Actual result: Width and Height values in Rect Transform components change after entering play mode.
Reproduced with: 2019.2.0a2, 2019.1.0b1, 2018.3.3f1.
Workaround: Call GetComponent<TMP_Text>() in the Start() function.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
Resolution Note:
Behavior is the result of setting the text to null and as per my notes to the customer, the behavior is by design.