How do I use mouse look for my FPS?

I’ve looked around and cannot seem to find a simple how to on mouse look. I’m making a FPS and I would like to look around with the mouse. I have a FP Controller with mouse look C# attached with mouseX as axes. Then my main camera(which is a child of the FP controller) has mouse look C# attached with mouseY as the axes. Now when I play my game the camera does not follow the mouse. Can anyone help? The only tutorials I see are about writing my own mouse look script.

If you imported all the packages, there should be a script that allows you to look around in FPS. When you test the game however, your cursor will go off screen while the FPS is still looking around. If you run a build, that would not be the case.

@ratmstein

So if you need any more help just ask me, I’m a beginner coder but i know some things so this is my Mouse Look script, it comes with a tutorial on what to do in unity as well,

UNITY TUTORIAL
so in unity create an empty object > make it a parent of the main cam > give the empty object a character controller component > then apply a “cylinder” body to it to make it actually visible.

SCRIPT (make sure you apply this script to the main camera that is on the player, you don’t wanna have it on the empty object)

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

public class MouseLook : MonoBehaviour
{

public float mouseSensitivity = 100f;

public Transform playerBody;

float xRotation = 0f;

// Start is called before the first frame update
void Start()
{
    Cursor.lockState = CursorLockMode.Locked;
}

// Update is called once per frame
void Update()
{
    float MouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
    float MouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;

    xRotation -= MouseY;
    xRotation = Mathf.Clamp(xRotation, -90, 90);

    transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
    playerBody.Rotate(Vector3.up * MouseX);
}

}

@BeginnerPlzHelp yeah, well more specifically I’m talking about how this is working, also I know this code, it’s from Brackeys, and yes how do I know? It’s because I used the same exact code