How do you know that it is not working?
If the player is moving, and the camera is moving with the player, then from the camera's point of view, the player will not be moving.
Also, an easier way to make the camera move with the player is to make a camera a child of the player. Then no camera code is needed to move it.