Add sideways force to camera

Hi, I’m creating a camera controller script and have successful movement forward and backward with this approach…

if ( Input.GetKey(KeyCode.W)) rigidbody.AddForce(cam.forward * change, ForceMode.Impulse); 

But am unable to find the correct command for ‘sideways’. I’ve tried ‘horizontal’ and ‘left’. Does anyone know how to change ‘cam.forward’ to sideways movement?

Check out Add Relative Force. Using that, you could extend your system with a mouse look at a later time, if you wanted.

As for moving right, check this answer out (don’t forget to use UA’s search function); it comes down to supplying the right (ahem…) vector3. In your case, the relative vector3 you’d want to feed AddRelativeForce would be (1,0,0).