- Home /
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?
Answer by Anxo · Dec 28, 2011 at 12:31 AM
public var Player : Transform;
function Update(){
transform.position.x = Player.position.x;
}
Answer by Alverndbl · Dec 28, 2011 at 03:36 AM
You should try the official 2d tutorial :
http://unity3d.com/support/resources/tutorials/2d-gameplay-tutorial
also if you don't want to add depth to polygons, you should try to make the camera orthographic (in the inspector)
Answer by POLYGAMe · Dec 27, 2011 at 09:46 PM
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.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to make 2d distortion? 2 Answers
2D sprite that always faces the player? 1 Answer
Switching Cameras at runtime 1 Answer
how to instantiate along x,z planes? 1 Answer