Crouch script not working

Watched a tutorial on crouch script I don’t know we its not working heres the script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class crouch : MonoBehaviour
{
CharacterController characterCollider;
// Start is called before the first frame update
void Start()
{
characterCollider = gameObject.GetComponent ();
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.LeftControl) ) {
characterCollider.height = 1.0f;
}
else
{
characterCollider.height = 3.8f;
}
}
}

What do you want the script to do? What is it doing instead? The only thing CharacterController.height changes is the height of the character’s capsule collider: Unity - Scripting API: CharacterController.height

its doing nothing I want it to move the camera down

Hmmm, well how do they move the camera down in the tutorial you watched? Did you follow their steps exactly?

the tutorial I copied exactly and in the video the capsule moved and so did the camera

So I found your tutorial (I think). It’s important to note that this tutorial starts with the Standard Asset FPSController asset. Are you using that asset?

that’s the tutorial I did not sea the it used the asset

nevermind I made tweeks to the code and now I can crouch

but now sometimes it goes threw the floor