An error that says (BCE0019:'enabled' is not a member of 'UnityEngine.Component'.)

Hi again, When I use this code to disable another script I get this error

GetComponent(“Move”).enabled = false;

The error says “BCE0019:‘enabled’ is not a member of ‘UnityEngine.Component’” :face_with_spiral_eyes:

c#, javaScript, boo?

javaScript

The gameObject that has the script that is calling GetComponent(“Move”).enabled = false;
can not see the gameObject that has the move script attached. you can do something along the lines of

var thisobject : GameObject
thisobject.GetComponent(“Move”).enabled = false;

Thanks, I’ve done that too but still same problem!!!

This is incorrect. GetComponent is called on the GameObject it was executed on.
So it will allways find the GameObject.

GetComponent(Move).enabled
You should use the class name instead of entering a string.

I should have just pointed out the documentation instead of fumble over my wording