Character movement not working.

Im making my first 2D game and im trying to get my character movement to work. I’ve made a script and i have a character controller but my player won’t move in any direction.

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

public class CharacterMovement : MonoBehaviour
{

    public CharacterController2D controller;
   
    public float runSpeed = 40f;

    float horizontalMove = 0f;

    void Update()
    {
        horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
    }

    void FixedUpdate()
    {
        controller.Move(horizontalMove * Time.fixedDeltaTime, false, false);
    }
}

That’s my movement script. when I press play the console give me an error about:

UnassignedReferenceException: The variable m_GroundCheck of CharacterController2D has not been assigned.
You probably need to assign the m_GroundCheck variable of the CharacterController2D script in the inspector.
UnityEngine.Transform.get_position () <0x1daa8b44e70 + 0x0006a> in <3bd64dd808f046b38ba2fb6667d0adc4>:0
CharacterController2D.FixedUpdate () (at Assets/Scripts/CharacterController2D.cs:51)

The problem is when I go on my controller script Visual Studio says there’s no error. I don’t know if the error makes it so i cant move or there’s a problem with my script please help i’ve been trying to do this for hours

In the inspector (in unity editor, not VS), find your m_GroundCheck variable (and quick possibly just the CharacterController2D) object and set it. If that is not correct, add a Start() script where you create the CharacterControlled2D

public Start()
{
controller = new CharacterController2D();
}

I forgot to set the ground and ceiling checks thank you so much.

Where did you get your CharacterController2D?