get component from C# to javascript possible?

works with c# to c# for me, works with javascript to c#, javascript to javascript

but when i try c# to javascript it says it cant find type or namespace why is this and how can i fix it?:face_with_spiral_eyes:

the javascript and the c# code are both in standard assets folder.

public Creator someScript;

....

someScript = builder.GetComponent<Creator>();

It’s just compilation order. C# compiles first, then js… so anything to C# will work. If you need C# to see js then you’ll need to make the js compile first. Putting the js in Standard Assets will do it.

where should i put the c# script? should i put it in a folder or something?
cuz i moved both many times

okay i got it to work lol and well i have a big delema now… i have a c# not able to connect to a c# now… why? they are in the same folder, i moved them both to the outside of the standard assets folder

is there a way i can set when each script will run, like the order?

In Unity 3.4 there is a way to change the execution order, but I don’t think thats the same as compilation order which is why your having issues. You could play with it though, I haven’t yet. (its under Edit>>Project Settings>> Script Execution Order)

Main thing is to access script A from script B, A has to be compiled first. So if A is js and B is C# A will have to be placed in Standard Assets, or some other folder that compiles prior to the one B is in. More info on compilation order here.

If you have a large number of scripts of various types though, these folders can get to be annoying. In that case I’d suggest, first trying to get as much as possible in single scripts so they don’t have to constantly talk to each other, and if thats not an option then create a main script or some sort of manager script in C# that can be used to pass variables back and forth between other scripts.