Attach a script to another script problems C#

I'm have a couple weird problems with attaching scripts inside other scripts.

I have a game object on the stage with the following script.

using UnityEngine; using System.Collections;

public class GameManager : MonoBehaviour {

public LevelManager levelManager;


And I created the other script which looks like the following

using UnityEngine; using System.Collections;

public class LevelManager : MonoBehaviour {


Now when I try to drag and drop the script onto the spot in the scripts variables in the unity GUI it wont attach. Also when I click the little browse circle it wont show up in the list.

I've tried it with multiple scripts and I'm having the same problem.

You need to attach the script to an object in the scene first, then drag that OBJECT into your other script.. not the script file itself.

Please make sure the LevelManager class has the attribute [Serializable]. Otherwise it wont show in the inspector.

I cannot find a problem in any of your code. I have done just this sort of thing hundreds of times in my project, and it works. Try right clicking on any asset, and selecting "reimport all". I find that fixes a lot.