ChatacterController.isGrounded does not get called!

no need to shoe any sample code because isGrounded never becomes true, can anybody please tell me what the terrain need be like so that the controller gets grounded, I’m using simple cubes with box colliders, also tried adding rigidbodies etc, nothing works.
although yesterday everything was working perfectly, what’s worng with that damn property?

looks like OnControllerColliderHit(ControllerColliderHit hit) is not working which explains maybe why isGrounded is nor working if it’s dependant on it, anyone know why?

are you adding gravity every Move?
if you dont, the CC never touches ground, and isGrounded is therefore always false

void Start () {
        controller = gameObject.GetComponent<CharacterController>();
	}
	
	// Update is called once per frame
	void Update () {
        if (controller.isGrounded)
        {
            moveDirection.x = factor;
            print("We are grounded");

            if (Input.GetMouseButton(0))
            {
                moveDirection.y = jump;
                animation.CrossFade("Jump");
            }
            else if (!animation.isPlaying)
            {
                animation.CrossFade("Run");
            }
        }
        moveDirection.y -= gravity * Time.deltaTime;// deltaTime necessary
        controller.Move(moveDirection*Time.deltaTime);
	}

there you go, I said the same code was running yesterday, plus I see the controller going down and through the floor without isGrounded ever being called, the floorhas just a boxcollider right, whats wrong?

Is the CC starting at some point ABOVE the ground , if the CC starts the game already touching the ground, then it might be considered penetrating, and thus treated as airborn - its reasonable practice to start a CC hovering slightly above ground so the physics can settle

john, thats exactly what I thought at the beginning, but the CC is well above the floor, it just penetrates it, could you maybe tell me if there are any other start conditions like this relating to collider setup and whatnot or is it just a CC on one hand and a Static box collier on the other?
still no isGrounded==true.:frowning:

Hey man idk, i put your script on a new CC in a blank scene, and it was fine, you arent doing anything complex in the script.
The floor and CC on the same layer / different layers without messing with the layer collisions matrix? CC component disabled? are your delttimes too big (low fps)

Dear John;) you nailed it (how stupid am I!) it’s the Layer Collision Matrix in the Physics Manager, the reason is that I imported 2D Infinite Runner starter kit yesterday which messed with the matrix and unchecked Default-vs-Default collision, once I rechecked that case everything works like a charm.
I suspected that might be it but I thought CC works entirely independant from physics.
Thank you so much, I learned my lesson good (no more corner-cutting wannabe starter kits:)).bye.

I just deleted the whole Project Settings folder from the unity project and restarted Unity to have brand new project setting and default layers again.