Search Unity

Javascript problem

Discussion in 'Scripting' started by Bootstrap Bill, Nov 26, 2010.

  1. Bootstrap Bill

    Bootstrap Bill

    Guest

    Joined:
    Jan 19, 2010
    Posts:
    46
    I have a simple test scene with two cubes (CubeA and CubeB) and each has a script attached to it (ScriptA and ScriptB).

    I want the code in CubeA to be able to access the code in Cube B. I can do the following

    //ScriptA

    ScriptB.Test();


    What I really want to do is more like this

    //ScriptA
    CubeB.Test();


    Is there any way to do this?
     
  2. Chris-Sinclair

    Chris-Sinclair

    Joined:
    Jun 14, 2010
    Posts:
    1,326
  3. Bootstrap Bill

    Bootstrap Bill

    Guest

    Joined:
    Jan 19, 2010
    Posts:
    46