One question here,about accessing gameobject.

I have 2 objects in scene.
A with Otherscript.js component
Gameobject with NewBehaviourScript.js component

Otherscript.js inside code is like this

var foo = 5;
function DoSomething ( param : String)
{
print(param + " with foo: " + foo);
}

NewBehaviourScript.js inside code is like this.

var target : OtherScript;
function Update () {
target.foo = 2;
target.DoSomething(“Hello”);
}

question is this: I saved unity always tell me
The name ‘OtherScript’ does not denote a valid type. Why?

many thanks![/b]

Because you have a type in OtherScript. You write it once with a captial S, the other time with a lowercase s. Changing that should do it.

Change:

var target : Other**S**cript;

to

var target : Other**s**cript;

So thankyou
it works, ou my fault.