How to make camera move?

I need to move my camera smoothly and slowly forward.Because I want to make better look of game menu.I created menu and want to move my camera forward and then backward.how to do that.Thank you inadvance.

That can be done from animating your camera in unity. Open the window/animation in the editor menu. and set a keyframe for the first position and then slide the timiline slider a good amount of frames away(100) and set the other keyframe, Pretty much that simple after you ofc choose the camera and create a new animation. But you can ofc script this movement as well, two examples of how to do this would be the 2D platform tutorial where the platform itself moves from one game object to the other and back(where ever the waypoints are put). and the other would be the laser trap on the Lerpz 3d game demo also shows how to get a gameobject to move back and forth :smile: Hope this helps a third would be the iron sights script at the unity wiki :smile:

awesome xD I didnt know that unity have animation manager.Very cool.BTW thank you for your answer

void FingerGestures_OnPinchMove( Vector2 fingerPos1, Vector2 fingerPos2, float delta )
{

print(“scaling”);
transform.LookAt(target);
transform.Translate(Vector3.forward * Time.deltaTime);

}

this is my code and my cmeera only moves forward not backward …how can i do it, plz help me out…thnks in advance

void FingerGestures_OnPinchMove( Vector2 fingerPos1, Vector2 fingerPos2, float delta )
{

print(“scaling”);
transform.LookAt(target);
transform.Translate(Vector3.forward * Time.deltaTime);

}

this is my code and my cmeera only moves forward not backward …how can i do it, plz help me out…thnks in advance

transform.Translate([COLOR="red"]-[/COLOR]Vector3.forward * Time.deltaTime);

Vector3.forward = forward.
-Vector3.forward = backward
Vector3.up = up
-Vector3.up = down
Vector3.right = right
-Vector3.right = left

i want to move my camera backward as well as forward and want to set limit for its forward and backward how???..:slight_smile: