Object won't destroy itself

My code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Move : MonoBehaviour {

	// Use this for initialization
	void Start () {
	// Update is called once per frame
	void Update () {
		transform.position += new Vector3(Input.GetAxis("Horizontal"), 0,0);

	void onColliderEnter (Collider other)
		if (other.gameObject.tag == "BadEnemy") {
			Destroy (gameObject);
			Debug.Log ("Been Hit");


Nothing appears in the console, nor will the player destroy itself. The “BadEnemy” is a cube with a rigidbody with a box collider. My player’s collider is a sphere collider.

Try replacing onColliderEnter with OnCollisionEnter.

You could also set an OnTrigger to the enemy. Set a tag on your player called “Player”. Then in your code, make it so that when something touches the enemy (thus triggering it) and it has the tag “Player”, it transforms.