(Help) cannot convert from 'float' to 'UnityEngine.Vector3'

Here’s My Code:

using UnityEngine;

public class Player_Crouch : MonoBehaviour
{
    private CharacterController m_CharacterController;
    public KeyCode crouchKey = KeyCode.C;
    public KeyCode jumpKey = KeyCode.Space;
    private bool m_Crouch = false;
    private float m_OriginalHeight;
    [SerializeField] private float m_CrouchHeight = 0.9f;

    void Start()
    {

        m_CharacterController = GetComponent<CharacterController>();
        m_OriginalHeight = m_CharacterController.height;
       
           
           
    }


    void Update()
    {
        if (Input.GetKeyDown(crouchKey))
        {
            m_Crouch = !m_Crouch;
            CheckCrouch();
        }

    }
   
    void CheckCrouch()
    {
       
        if (m_Crouch == true)
        {
            m_CharacterController.height = m_CrouchHeight;
           
        }
        else if (Input.GetKeyDown(crouchKey) && m_CharacterController.height == m_CrouchHeight)
        {
            m_CharacterController.height = Vector3.Lerp(m_CrouchHeight, m_OriginalHeight, Time.deltaTime);
        }
      

    }
}

The problem line is (43,57) and (43,73). Basically, I want it that if I press the “crouch” button when I’m in a crouching position, I go back to my original height over time instead of “snapping” to my original height.

You probably mean to use Mathf.Lerp instead of Vector3.Lerp.
That said though, Time.deltaTime won’t do what you think it will with any “Lerp” functions.

The third parameter should be any number between 0 and 1, where:

  • A value of 0 will return exactly the first parameter.
  • A value of 1 will return exactly the second parameter.
  • A value of 0.5 will return exactly the mid-point of both parameters.

Mathf.MoveTowards is probably what you want to use instead.