GetComponent with Standard Assets? C#

I can’t seem to reference the script component via GetComponent.

GetComponent<AeroplaneController>().enabled = true;

i get an error like this
error CS0246: The type or namespace name `AeroplaneController’ could not be found. Are you missing a using directive or an assembly reference?

Hi @alex11704.

The reason you are getting this error is because you are not using the same namespace where the “AeroplaneController” script resides.

From the top of the AeroplaneController -script you can find the line:

namespace UnityStandardAssets.Vehicles.Aeroplane

This means you need to include this namespace to the script where you want to access the aeroplanecontroller. To solve this problem, put this on top of your script below default namespaces:

using UnityStandardAssets.Vehicles.Aeroplane;

Same thing with other standard assets. Here is a link to namespaces reference: Unity - Manual: Namespaces.

Also, what i recently found out: Some of the folders are compiled before the others. I’m in such a hurry that I can’t look for the right site, but standard assets folder is one of those folders. That can also alter your access to the files. Please correct me if I’m wrong.