FPS camera cannot be moved up and down when rotated if I try to tilt camera when wallrunning

I have a script set up for general fps movement and wall-running. I want to tilt the camera on the z-axis accordingly when the player is a wall running but if I don’t that it overrides the y-axis camera rotation
Here I will attach the script for the movement of the player which has the wall running. The four lines found at lines 102, 103, 108, and 109 are the way I tried rotating the camera and all of them override the y-axis movement of the camera.

using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Unity.VisualScripting;
using UnityEditor.Experimental.GraphView;
using UnityEditor.XR;
using UnityEngine;

public class PlayerMove : MonoBehaviour
{
    public CharacterController cc;
    public Rigidbody rb;
    public GameObject Camera;
    public Transform Orientation;
    public float Speed;
    public float gravity;
    public float Jumph;
    public int Jump=1;
    public bool Gravity;


    public Transform GroundCheck;
    public float groundDist;
    public LayerMask GroundMask;

    Vector3 velocity;
    public bool Grounded;

    //Wall running
    public LayerMask Wallmsc;
    public float WRforce, WRmaxTime;
    public bool WallLeft, WallRight;
    public bool WR;
    public float WRcamTilt;

    void Update()
    {
        Movement();
        CheckForWall();
        WRInput();
    }
    void Movement()
    {
        Grounded = Physics.CheckSphere(GroundCheck.position, groundDist);

        if (Grounded && velocity.y < 0)
        {
            velocity.y = -2f;
        }
        float X = Input.GetAxis("Horizontal");
        float Z = Input.GetAxis("Vertical");

        Vector3 move = transform.right * X + transform.forward * Z;

        cc.Move(move * Speed * Time.deltaTime);

        if (Input.GetButtonDown("Jump") && Jump > 0)
        {
            Jump = Jump - 1;
            velocity.y = 0;
            velocity.y = Mathf.Sqrt(Jumph * 2f * gravity);
            if (WR == true)
            {
                WRend();
                Jump = Jump - 1;
                velocity.y = 0;
                velocity.y = Mathf.Sqrt(Jumph * 2f * gravity);
            }
        }
        if (Grounded == true)
        {
            Jump = 1;
            Speed = 10;
        }
        if (Gravity == true)
        {
            velocity.y += -gravity * Time.deltaTime;

            cc.Move(velocity * Time.deltaTime);
        }
    }
    //wallrunning:
    private void WRInput()
    {
        //Start wallrun
        if (Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.D) && WallRight && !Grounded) WRstart();
        if (Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.A) && WallLeft && !Grounded) WRstart();
        if(Input.GetKeyUp(KeyCode.W) || WallLeft && Input.GetKeyUp(KeyCode.A) || WallRight && Input.GetKeyUp(KeyCode.D))
        {
            WRend();
        }
    }
    private void WRstart()
    {
      Gravity = false;
      WR = true;
      Speed = 20;
      //Character need to stick to wall
      if (WallRight)
      {
        rb.AddForce(Orientation.right * WRforce/5 * Time.deltaTime);
        //Camera.transform.localRotation = Quaternion.Euler(0, Camera.transform.localRotation.y, WRcamTilt);
        //Camera.transform.localRotation = Quaternion.Euler(0, 0, WRcamTilt);
        }
      else
      {
       rb.AddForce(-Orientation.right * WRforce / 5 * Time.deltaTime);
       //Camera.transform.localRotation = Quaternion.Euler(0, Camera.transform.localRotation.y, -WRcamTilt);
       //Camera.transform.localRotation = Quaternion.Euler(0, 0, -WRcamTilt);
        }
      Invoke("WRend", WRmaxTime);

    }
    private void WRend()
    {
        Gravity = true;
        WR = false;
    }
    private void CheckForWall()
    {
        WallRight = Physics.Raycast(transform.position, Orientation.right, 1f, Wallmsc);
        WallLeft = Physics.Raycast(transform.position, -Orientation.right, 1f, Wallmsc);

        //leave wall run
        if (!WallRight && !WallLeft) WRend();
        if (WallRight || WallLeft)
        {
            Jump = 2;
        }
    }
}

How do I tilt this camera while still allowing the y-axis mouse movement of the camera script?
Additionally: here is the camera fps look script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerCameraLook : MonoBehaviour
{
    [SerializeField]
    Transform character;
    public float sensitivity = 2;
    public float smoothing = 1.5f;

    Vector2 velocity;
    Vector2 frameVelocity;
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
    }
    private void Update()
    {
        // Get smooth velocity.
        Vector2 mouseDelta = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y"));
        Vector2 rawFrameVelocity = Vector2.Scale(mouseDelta, Vector2.one * sensitivity);
        frameVelocity = Vector2.Lerp(frameVelocity, rawFrameVelocity, 1 / smoothing);
        velocity += frameVelocity;
        velocity.y = Mathf.Clamp(velocity.y, -90, 90);

        // Rotate camera up-down and controller left-right from velocity.
        transform.localRotation = Quaternion.AngleAxis(-velocity.y, new Vector3(1,transform.localRotation.y,transform.localRotation.z));
        character.localRotation = Quaternion.AngleAxis(velocity.x, new Vector3(character.localRotation.x,1,character.localRotation.z));
    }
}

Camera stuff is pretty tricky… you may wish to consider using Cinemachine from the Unity Package Manager.

There’s even a dedicated forum: Unity Engine - Unity Discussions

If you want to debug what you have, use LOTS of visualization (with Debug.DrawRay() for instance) and very specific setup scenes to isolate what is going wrong.

Time to start debugging! Here is how you can begin your exciting new debugging adventures:

You must find a way to get the information you need in order to reason about what the problem is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

What is often happening in these cases is one of the following:

  • the code you think is executing is not actually executing at all
  • the code is executing far EARLIER or LATER than you think
  • the code is executing far LESS OFTEN than you think
  • the code is executing far MORE OFTEN than you think
  • the code is executing on another GameObject than you think it is
  • you’re getting an error or warning and you haven’t noticed it in the console window

To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

Doing this should help you answer these types of questions:

  • is this code even running? which parts are running? how often does it run? what order does it run in?
  • what are the names of the GameObjects or Components involved?
  • what are the values of the variables involved? Are they initialized? Are the values reasonable?
  • are you meeting ALL the requirements to receive callbacks such as triggers / colliders (review the documentation)

Knowing this information will help you reason about the behavior you are seeing.

You can also supply a second argument to Debug.Log() and when you click the message, it will highlight the object in scene, such as Debug.Log("Problem!",this);

If your problem would benefit from in-scene or in-game visualization, Debug.DrawRay() or Debug.DrawLine() can help you visualize things like rays (used in raycasting) or distances.

You can also call Debug.Break() to pause the Editor when certain interesting pieces of code run, and then study the scene manually, looking for all the parts, where they are, what scripts are on them, etc.

You can also call GameObject.CreatePrimitive() to emplace debug-marker-ish objects in the scene at runtime.

You could also just display various important quantities in UI Text elements to watch them change as you play the game.

Visit Google for how to see console output from builds. If you are running a mobile device you can also view the console output. Google for how on your particular mobile target, such as this answer or iOS: How To - Capturing Device Logs on iOS or this answer for Android: How To - Capturing Device Logs on Android

If you are working in VR, it might be useful to make your on onscreen log output, or integrate one from the asset store, so you can see what is happening as you operate your software.

Another useful approach is to temporarily strip out everything besides what is necessary to prove your issue. This can simplify and isolate compounding effects of other items in your scene or prefab.

Here’s an example of putting in a laser-focused Debug.Log() and how that can save you a TON of time wallowing around speculating what might be going wrong:

“When in doubt, print it out!™” - Kurt Dekker (and many others)

Note: the print() function is an alias for Debug.Log() provided by the MonoBehaviour class.