Camera rotate using arrow keys, movement with WASD?

I am working on a fun little game, but I can’t seem to figure out how to make the camera rotate with the arrow keys, and the player walks with WASD (including jumping with space) to somewhat simulate a retro-styled game, where you need to have all hands on the buttons.

Right now I have a camera object as the player’s character, and it rotates left and right based on horizontal input (not arrow keys) and up and down on vertical input. I have spent a while trying to figure out how to get this to work.

Can anyone help with this? Thank you.

Just look for any basic movement and camera script and replace the buttons :smiley:

Try using the Input.GetKey function and using a series of if, else if, and else statements to map those keys to the rotation of your camera or whatever else you want to do.

@Green_Kat_Studios Try this script.


 `
    Vector3 velocity;
    
    private void KeyboardInput()
    {
            var h_Input = Input.GetAxis("Horizontal");
            var v_Input = Input.GetAxis("Vertical");
    
            Vector3 translation = v_Input * transform.up;
            translation += h_Input * transform.right;
            translation.z = 0;
    
            if (translation.magnitude > 0)
            {
                velocity = translation;
            }
            else
            {
                velocity = Vector3.zero;
            }
    
            if (velocity.magnitude > 0)
            {
                   var lookRotate = Quaternion.LookRotation(velocity);
                   transform.rotation = Quaternion.Slerp(transform.rotation, lookRotate, Time.deltaTime * rotationSpeed);
            }
    }`