Collision detect not working

This is my youWon.js file:

#pragma strict

function OnCollisionEnter(collision : Collision) {
	if(collision.collider.tag=="winCube"){
		Debug.Log("You hit it");
	}
}

I add it to my “Player” object, which I control, but the console won’t output anything.

The object I want to hit is called “winCube”

Given that you are using a character controller, use OnControllerColliderHit() rather than OnCollisionEnter().