Reputation: 11
Alright so I'm learning unity right now and I opened my game this morning and ran into this error code
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619:
'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
I have tried replacing GUIText
with UI.Text
however that lead to a different error messages of:
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0246:
The type or namespace name 'UI' could not be found (are you missing a using
directive or an assembly reference?)
or
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0246:
The type or namespace name 'UIText' could not be found (are you missing a using
directive or an assembly reference?)
Can anybody help me out here?
Upvotes: 1
Views: 3065
Reputation: 20
Don't forget to change your Library to the following:
Using UnityEngine.UI;
instead of
Using UnityEngine;
I'm new to Unity. And I hope it works.
Upvotes: 0
Reputation: 3
Add this line :
using UnityEngine.UI;
and then replace :
GUIText with Text
Upvotes: 0
Reputation: 2180
You should fallow these steps
Upvotes: 0
Reputation: 11
you can just replace it using Text from UnityEngine.UI
Here's an example:
using UnityEngine.UI;
namespace YourNameSpace.Utility
{
public class YourClass : MonoBehaviour
{
public Text myText;
void Start()
{
myText.text = "Your text here";
}
}
}
Upvotes: 1
Reputation: 914
You cannot simply replace GUIText with Text unfortunately. Check this answer out:
GUIText is deprecated, so what should I use instead of it?
Upvotes: 1