Newbie question on syntax...
I have the mainCamera in the game and I have attached the smoothfollow script to it.
I instantiate the gameobject when the game starts dynamically that I want the camera to follow so I can't set the target in the inspector.
Thanks for any help.
Something close to this:
var sf : SmoothFollow = Camera.main.GetComponent(SmoothFollow);
sf.target = myNewObject.transform;
You could use the function GetComponent and assign the instantiated GameObject to the variable "target" of the script:
var script : SmoothFollow;
script = Camera.main.GetComponent("SmoothFollow");
var prefab : Transform;
var clone : Transform;
clone = Instantiate (prefab, ... );
script.target = clone;