OnControllerColliderHit won't trigger if not moving

Hi, I have a wall that moves and if it hits you you are supposed to die, the problem is, that is only triggered if the character controller is moving, so if you stay still, the wall goes throught you and you don’t die, is there anyway way to fix this issue? By the way the wall has a rigidbody attached to it

Thanks in advance.

Edit: Adding some code by request, only the important part of it

void OnControllerColliderHit (ControllerColliderHit hit) {
		if (hit.transform.tag == "PowerUp"){
			PowerUpScript powerUpScript = hit.transform.GetComponent<PowerUpScript>(); ......... not showing all this part since it doesn't matter
		}
		else if (hit.transform.tag == "NeonWall") {
			ApplyDamage();
		}
	}

void ApplyDamage () {
	Destroy(gameObject);
}

edit 2: Unity - Scripting API: MonoBehaviour.OnControllerColliderHit(ControllerColliderHit)

“OnControllerColliderHit is called when the controller hits a collider while performing a Move.” From my understanding, it will only be called when the character controller is moving, is that right? is there a workaroud? I really need one.

Use a standard OnCollisionEnter (I think on the wall, or on the player.)

During the physics step, then player counts as a regular stationary collider. So it can be hit by rigidbodies, and will give/get OnCollisionEnter based on their motion. As you note, OnCharConHit is only triggered when the player moves. The whole charController thing is sort of a hack:

The normal physics system moves everything together, in the “physics step”, outside of all scripts. That’s where it calls OnCollisionEnter/Exit. But CharControllers skip physics (to move more like a computer game player.) They move during the script. As far as the physics system is concerned, they magically teleport when it isn’t looking. So they won’t fire an event moving into non-rigidbodies, maybe things that are asleep… . OnCharConHit is a fix, to see all colliders, and happens during the move command (I think.)

yes because you are programing “OnControllerColliderHit” that means when this controller hit something not when something hit it, so, you have to use:
OnCollisionEnter(GameObject c) {

  if(c.tag == "Something"){ // c have to have a rigidbody

    doSomething....

}

}