Roll a ball cubes not deactivated

Hi,

I am a beginner on Unity3D. I am working on Roll a ball tutorial.

When tested the Colliding part, the collectible cube is not deactivated even after player has collided with these cubes. Instead player will pass through them. Check the picture attached.

Below is the code:

public class PlayerController : MonoBehaviour {

public float speed;
private Rigidbody rb;

void Start(){
	rb = GetComponent<Rigidbody> ();
}

void FixedUpdate(){
	float moveHorizontal = Input.GetAxis ("Horizontal");
	float moveVertical = Input.GetAxis ("Vertical");

	Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
	rb.AddForce (movement * speed);
}

void onTriggerEnter(Collider other)
{
	if (other.gameObject.CompareTag ("PickUpCube")) {
		other.gameObject.SetActive (false);

	}
}

}

Not sure how to resolve this. Require help.

Thank you!

void OnTriggeEnter(Collider other) {

}

Note the “O” in uppercase, that’s the method expected by Unity, onTriggerEnter (in lowercase) won’t be called automatically.

I believe onTriggerEnter is supposed to be OnTriggerEnter with a capital ‘O’. Notice how the default Unity methods are highlighted in purple. A tip for the future: In method names, all first letters of a word are capitalized. For example:

public void NewMethod ()
{
     //Do some stuff
}