I'm not sure if i'v phrased the question right. what I need to do is set an object (camera) in the inspector at runtime similar to this
var me : GameObject;
function Start()
{
if (me == null)
{
me = GameObject.FindWithTag("player1");
}
this returns the game object in the scene and sets it in the inspector of my script. I'm trying to replicate the same thing but returning a camera instead. this is what i have so far.
var deathCam : Camera;
function Start()
{
if (deathCam == null)
{
GameObject.Find ("MainCamera");
}
i put debug logs in and they all get set off so my script is running through fine however its not setting the camera in the inspector. What am i doing wrong?