Introduction
In this article we will see how to solve the error “GUIText is obsolete” in Unity, an error that started to occur several versions ago because the GUIText programming class was replaced by another one and there are still many Unity packages using the previous version.
In the following video we see how I solve this error that appears when importing the Standard Assets package. This is an error that is simple to solve but it is important that you understand why it occurs and what to do, since the error can occur in countless cases, you will have to identify how to do it in your particular case.
Steps to solve “GUIText is obsolete” in Unity
1. Open all the scripts that contain this error. Help yourself with the error information in Unity’s console (clicking on the error will give you some extra information), the console will tell you the name of the script and the error line. If we double-click on the error, the script will open and the error line will be highlighted.
2. It is necessary to replace the use of the “GUIText” fields by the “UnityEngine.UI.Text” class. That is, where we see that “GUIText” is used (case sensitive), delete it and write “UnityEngine.UI.Text” instead.
3. Save the script and verify in the console that the error disappears.
Optional: The prefix “UnityEngine.UI” can be included in the script header, that way we can refer to the component directly as “Text”. See lines 3 and 12 in figure 4.