Camera is not rotating with mouse

So I’ve been following Plai’s tutorial on youtube on a rigidbody FPS Controller and it does not follow the mouse

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

public class PlayerCamera : MonoBehaviour
{
    [SerializeField] private float sensX;
    [SerializeField] private float sensY;

    Camera cam;

    float mouseX;
    float mouseY;

    float multiplier = 0.01f;

    float xRotation;
    float yRotation;

    private void Start()
    {
        cam = GetComponentInChildren<Camera>();
    }

    private void Update()
    {
        MyInput();

        cam.transform.localRotation = Quaternion.Euler(xRotation, 0, 0);
        transform.rotation = Quaternion.Euler(0, yRotation, 0);
    }

    void MyInput()
    {
        mouseX = Input.GetAxisRaw("Mouse X");
        mouseY = Input.GetAxisRaw("Mouse Y");

        yRotation += mouseX * sensX * multiplier;
        xRotation += mouseY * sensY * multiplier;

        xRotation = Mathf.Clamp(xRotation, -90f, 90f);
    }
}

Camera should be coloured instead of greyed out. I’d say that cam is not recognized and

most probably nor working. Add a debug line like this to make sure of that:

    private void Start()
    {
        cam = GetComponentInChildren<Camera>();
        Debug.Log("Camera = " + cam);
    }

I’m also following this tutorial. Make sure your SenX and SenY, are both set to a number higher than 0. By default they’re set to 0. That was my problem at least.

7440500--912041--Screen Shot 2021-08-22 at 9.10.15 PM.png