How to assign a variable(camera) to a prefab at start? (not an object)
I have several cameras in my scene. They are all tagged main and I can not change the tag because they all need to be main due to some other code. I now need to assign all the cameras to a prefab at start.
I would like to find each camera by name(they each have unique names but not tags) then assign it to the available variable slot in the prefab at start.
Comment
So what code do you have so far? What have you tried?
Add detail and a question.
Answer by tanoshimi · May 03, 2016 at 11:28 AM
Finding a gameobject by name is exactly what GameObject.Find() is for : http://docs.unity3d.com/ScriptReference/GameObject.Find.html