Moving script in 3D + Camera Control?

Hi everybody,

just trying some 3D out and wanted to ask for a better movement-script.
Right now I’m using this kind of movement method

float Horizontal = Input.GetAxisRaw ("Horizontal");

     if (Horizontal >0)
     {
         transform.Translate(Vector3.right * WalkSpeed * Time.deltaTime);
     }
[...]

But this becomes a problem, eversince I also built in a script to rotate the camera.
(Dunno if the camera script is important, but I’m pasting it anyways):

CamTurnL = Input.GetButton ("CameraLeft");

     cam.transform.position = new Vector3 (player.position.x, player.position.y, player.position.z);
     cam.transform.Translate(new Vector3(0,4,-15));

     if (CamTurnL)
     {
    cam.transform.Rotate(Vector3.up * Time.deltaTime * camrotspd, Space.World);
     }

So the problem of course is, that my “player” still moves along the world axis.
So, is it possible to somehow make a vector to the camera?

So that I always move forward when pressing “up”, no matter which camera position.

         transform.Translate(Vector3.right * WalkSpeed * Time.deltaTime);

Change to

         transform.Translate(cam.transform.right * WalkSpeed * Time.deltaTime);

And similar for forward

All right, thanks it works,

I tried with “cam.vector3” but obivious it didn’t work, anyways, I’m glad that it’s just a small change.
Thanks again