Instantly move or change rotation of object through C# script

I’ve been trying to figure out how to change a unity object’s position and rotation without much luck. A quick example would be much appreciated!

Vector3 position = cam.transform.position;
plane.transform.position = position;

For whatever reason this creates a second plane instead of just changing the plane variable I already have.

Sorry for wasting your time. I got it! I’m creating my objects through script so whenever I hit run it reads every object to the hierarchy. Now I just have to figure out how to make unity remove the objects after play.