changing the target of camera through script

From a script attached to my trigger I want to change the smooth follow target of my main camera on trigger enter by an object. I have tried passing the main camera as a var to my trigger script then getting smooth follow and target through get component and setting it to a new target but it does not work.

Just grab the component off the main Camera.

// C#
SmoothFollow sf = Camera.main.GetComponent(typeof(SmoothFollow)) as SmoothFollow;
sf.Target = myTransform;

Make sure that the SmoothFollow script has its class name as "SmoothFollow". I'm not sure exactly what the property is for the "Target", so I just called it "Target". Change this to whatever it should be.