Cannot detect issue on Script

So I was doing my script for an assignment and when I tried to play, it came with two notifications:

Assets\Player.cs(36,30): error CS1061: ‘CharacterController’ does not contain a definition for ‘isGrounded’ and no accessible extension method ‘isGrounded’ accepting a first argument of type ‘CharacterController’ could be found (are you missing a using directive or an assembly reference?)

and

Assets\Player.cs(55,26): error CS1061: ‘CharacterController’ does not contain a definition for ‘Move’ and no accessible extension method ‘Move’ accepting a first argument of type ‘CharacterController’ could be found (are you missing a using directive or an assembly reference?)

Is there a way to fix this? I tried fixing it over and over again but, I am getting the same results.

Here is the script

// paste your code here instead of screenshotting a text editor

This is an odd error, and I’m not entirely sure what is causing it. If you want more help from me, it would help if you could send a unity asset file to me so I could poke around (I understand if that’s weird to do).

My only thought is that you somehow overrode the CharacterController name? Try using UnityEngine.CharacterController?

That is entirely a shot in the dark, however.

I also got unable to identify the issue, as CharacterController indeed haave an isGrounded (see Unity - Scripting API: CharacterController.isGrounded), so perhaps issue isnt in the script. If possible, could you try to use one script that uses Rigidbody? You would need to create your own isGrounded (what can be some problem for beginers, but i can help ;), but would be easier to indentify errors there, and you would have a well-tailored physics simulation made by unity. Basically, you would just need to check if player was on ground - what can be done with a raycast, if it touches the ground, you is in ground, and if not, you’re not on ground. Just be sure to calibrate raycast size. An example (made by ChatGPT where i didnt tested. May have errors):

using UnityEngine;

public class GroundCheck : MonoBehaviour
{
    public bool isGrounded;

    void Update()
    {
        // Cast a ray downwards to check for ground
        RaycastHit hit;
        float rayLength = 0.1f; // Adjust this based on your object's size
        if (Physics.Raycast(transform.position, Vector3.down, out hit, rayLength))
        {
            isGrounded = true;
        }
        else
        {
            isGrounded = false;
        }
    }
}

I hope i was helpfull… at least an AI may be