How Do I move cameras to be the same position?

Hi, I am trying to move a camera to the same position as another so I could make a smooth camera transition.

This would be done using three cameras, one for the starting point, one for the endpoint, and a transition camera.

Why is this code not working?

transitionCam.transform.position = new Vector3(currentCam.transform.position.x, currentCam.transform.position.y, -10);

For some reason every time I run it the camera is in a random position and I don’t know why.

Thank you for the help! :slight_smile:

Could you share a screenshot of your inspector and scene so we can see how it is set up? Not really seeing any issues with that line of code.