How can I get position of other game object and use it?

I want to get A’s position and camera can move to A’s position,then get B’s position and camera move to B’s position…etc.How could I do it?

I’d tried use


…but I couldn’t get the answer.

Rather than look for the object every time, why not use have a variable in your script that you use the inspector and drag and drop the object onto it.