Can't access own classes in imported script.

Hi there,

Well, the problem is exactly in the title.
I created a Player class i’d like to use into the standard RigidbodyFPSController script but it seems I can’t access it for some reason.
I tried to create my own script for test and I can access it this way…
I’m sure the problem is stupid but I have no idea how to fix it.

Thanks in advance.

EDIT : I moved my Player class file in the same directory as the RigidBodyFPSController and it works.
So you can’t access a file in a script if they’re not is the same directory ?

Hey.

What exactly do you mean by “I can’t access it”? You can’t access class variables from another script as if they were private or is it something else?

Certainly not. There’s no such restriction in Unity.

@AndreiKubyshkin Well no, I’m just meaning Visual studio seem not to find all the reference.
Autocomplete just won’t find it as if I never wrote the code. And if I use one of the class I just get a : “The type or namespace ‘XXX’ could not be found (are you missing a directive… bla bla bla)”

But the probleme only occurs with imported scripts
If I copy all the code into a new class in another file or try to access my classes in my own scripts, It works great.

(Sorry if i’m not clear, English’s not my mother tongue)

I see. I have similar problems. There were menu command for updating visual studio project in earlier versions of Unity, when visual studio tools were distributed separately. I can’t find this command in 5.3.

For me such problems usually disappear when I restart Visual Studio.

English is not my native language either, I believe we’re both russians:smile:

Well, no, I’m french actually :slight_smile:

I restarted VS many times since the problem occurred but it didn’t fix anything :confused:
That’s weird.

PS: I just looked in MonoDevelop and the problem is the same.
Something went wrong but I fail to understand what.

Omsk is a City in Syberia so I made a wrong guess, ha ha :slight_smile: Vive la France, my friend!

What is the folder path to scripts that don’t work?

http://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html

1 Like

Oh yeah, I knew it, many russians in CSGO try to talk with me in russian and then tell me Omsk is a city in Russia.
But, I choosed this pseudo randomly so that’s a real coincidence ^^.

@StarManta @AndreiKubyshkin Oh, that’s why, thank you. Indeed, the folder was “Standard Asset” so it couldn’t work.
Thanks to both of you :slight_smile: