Cant add script component

When trying to add a script to a gameobject an error box appears
It says script class cannot be found.

filename and class name are same and there is no other script with same name.
I am trying to add axistouchbutton script from standard assets to a button
What is the problem here?

Do you have any compile errors in the console?

Yeah,
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619: ‘GUIText’ is obsolete: ‘GUIText has been removed. Use UI.Text instead.’

Yep, there’s your real problem. You need to use Unity’s new UI system. The code you’re trying to use has been obsolete for about a decade at this point (UnityUI came out about 2010), though this is the first I’ve heard that those classes have been actually removed from the engine instead of just deprecated. If you’re following a tutorial or something, ditch it and find another - the tutorial you’re following is hopelessly outdated. (There are UnityUI tutorials in Unity’s Learn section)

2 Likes

Thanks Mate

From the scripting reference, it looks like it was removed with the release of 2019.3.