How to move camera with Input.GetAxis() and my camera view direction?!!

Public GameObject Camera1;

void Update () {
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");

Camera1.transform.Translate(h * 0.01f, 0f, v * 0.01f);

Its my code to move the camera but the problem is when i change the camera direction it goes at the direction that it was… I just want to make my camera go straight at my camera direction when im going forward!!! Please help me …its killing me!!!


Try making the camera a child object of an empty game object and move this script onto the empty game object. It should then work how you’re expecting it to.