Can't destroy script attached to GameObject, incomprehensible type error

In my scene, I have an instance of FPSController from the Characters standard assets named player. The following behavior happens when attempting to remove a script from it:

 Component FpsControllerScript = player.GetComponent(typeof(MonoBehaviour)); 

// prints "UnityStandardAssets.Characters.FirstPerson.FirstPersonController"
Debug.Log(FpsControllerScript.GetType().ToString());                              

 // prints exactly the same thing
 Debug.Log(typeof(FirstPersonController).ToString()); 

// prints "false", wtf???
Debug.Log(FpsControllerScript.GetType() == typeof(FirstPersonController));        

 // Does nothing
Destroy(player.GetComponent(typeof(FirstPersonController))); 

// Destroys script                    
Destroy(player.GetComponent(FpsControllerScript.GetType()));     

Any ideas? This type error doesn’t make any sense.

first of all u din’t put the errors u r getting… and second i think the problem must be because fpsController is a required component of another script!

see: Unity - Scripting API: RequireComponent

I’m not sure which bit you’re confused by, but judging by your WTF comment, it’s why

FpsControllerScript.GetType() != typeof(FirstPersonController);

The reason is quite simple: typeof(FirstPersonController) is a FirstPersonController, whereas FpsControllerScript is a generic Component (you declare it as such on the very first line of your script).

player.getComponent().enabled = false; will disable the script. Destroy deletes a gameobject and not a script.,