basic 2d sidescroller camera

I’m making a side scrolling game and i need the camera to follow the player but its a completely 2d game so i cant use the smooth follow, because it adds depth to the polygons, which is the only thing i can seem to find online, anyone else have any ideas of what to do?

public var Player : Transform;

function Update(){
transform.position.x = Player.position.x;

You should try the official 2d tutorial :

also if you don’t want to add depth to polygons, you should try to make the camera orthographic (in the inspector)

If you don’t want too much depth or 3d look to the polygons, use an orthographic camera. To stop the camera flipping to the other side, try restricting its rotation and movement along the z axis… should work.