how to use other objects from other scenes in a script?

could someone please explain to me how to use other objects in other scenes in a script? All Help is GREATLY appreciated! Thanks!

3 Answers

3

You can't use objects that don't exist in your scene unless you load them into your current scene. You can do this by either making a prefab and instantiating them or load the scene additively.

I have been using the Resources.Load method. You will need to make a new folder called Resources and put any assets or prefabs in this folder. You can then programmatically load these items using Resources.Load("myItem").

Take a look at the documentation here:- http://unity3d.com/support/documentation/ScriptReference/Resources.Load.html

Good luck!

Dave

The Main Problem of Resources folder is the Set that you have created will become a prefab by its own and the file size will increase.

Let us say I have created 15 sets in that level and I want to load it one by one as the level increase…
there is no way I have to make each sets as a prefab…