controller.isGrounded не работает в юнити, выдаёт ошибку
написал код для передвижения персонажа в unity.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMove : MonoBehaviour
{
//Добавляем ссылку на компонент CharacterController в инспектор
[SerializeField] CharacterController controller;
//Добавляем ссылку на переменную speed (скорость игрока) в инспекторе
[SerializeField] float speed = 5f;
//Создаем переменную гравитации для падения
[SerializeField] float gravity = 50;
//Создаем переменную для силы прыжка
[SerializeField] float jumpForce = 40;
//Создаем переменную для направления движения игрока
private Vector3 direction;
void Update()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
if (controller.isGrounded) //проверяем что мы на земле
{
if (Input.GetKey(KeyCode.LeftShift))
{
speed = 10f;
}
else
{
speed = 5f;
}
direction = new Vector3(moveHorizontal, 0, moveVertical);
direction = transform.TransformDirection(direction) * speed;
if (Input.GetKey(KeyCode.Space))
{
direction.y = jumpForce;
}
}
direction.y -= gravity * Time.deltaTime;
controller.Move(direction * Time.deltaTime);
}
}
В другом проекте работал, а сейчас выдаёт ошибку

Подскажите что делать пожалуйста