Weird error need help

Unity gives this error :
MissingComponentException: There is no ‘CharacterController’ attached to the “player” game object, but a script is trying to access it.
You probably need to add a CharacterController to the game object “player”. Or your script needs to check if the component is attached before using it.
UnityEngine.CharacterController.Move (Vector3 motion) (at C:/buildslave/unity/build/artifacts/generated/bindings_old/common/Physics/DynamicsBindings.gen.cs:3268)
FPSController.Update () (at Assets/FPSController.cs:36)
But i alreadyhave an component called player.

I have screenshot attachet .Can someone help me with this. my code is

using System.Collections;
using UnityEngine;

public class FPSController : MonoBehaviour {

    public float speed = 2f;
    public float sensitivity = 2f;

    CharacterController player;

    float moveFB;
    float moveLR;

    float rotX;
    float rotY;
    // Use this for initialization
    void Start () {

        player = GetComponent<CharacterController>();

    }
   
    // Update is called once per frame
    void Update () {

        moveFB = Input.GetAxisRaw("Vertical") * speed;
        moveLR = Input.GetAxisRaw("Horizontal") * speed;

        rotX = Input.GetAxis("Mouse X") * sensitivity;
        rotY = Input.GetAxis("Mouse Y") * sensitivity;

        Vector3 movement = new Vector3(moveLR, 0, moveFB);
        transform.Rotate(0, rotX, 0);

        movement = transform.rotation * movement;
        player.Move(motion: movement * Time.deltaTime);

    }
}

Hi
You should reference to GameObject called player and this GameObject should have component CharacterController.
Try like this:

public GameObject player; (drag drop this gameobject in inspector)
private CharacterController playerController;
(if this player gameobject will have component attached then)
void Start(){playerController = player.GetComponent<CharacterController>();}

Now you are trying to call CharacterController component from the CharacterComponent (what is not good) and this CharacterController is not even set :slight_smile:
If this FpsController is attached to your player, then make sure this player gamobject has also CharacterController component.

TomPo could you also look at my rotY,it doesnt move

Could you look at my rotY, it doesnt work