Suppose you have a folder structure as follows:
Scenes --> Scene_001 containing ( scene_1, script_1.js, SceneObject_1 )
I have attached the scripts to their respective scene objects; ie script_1 was drag connected to SceneObject_1, and so on.
What I would like to do is have script_1 execute a function in script_2. I tried to use
as well as
to get a handle on the SceneObject_2. It simply can not find the object. So, how do we find game objects that are not in the same scene and not in the same folder?
There is no folder structure in the hierarchy; you can have objects be parents and children but they are all in one "folder". GameObject.Find will find any object in the scene by name regardless. It will not find any objects in different scenes, since those objects do not exist until they are loaded.
answered Mar 14 '10 at 07:21 PM