2d Platformer Jumping Not Working

The movement works, but the OnCollisionEnter2d doesn’t seem to set jumpEnable to true.(I have also tried OnCollisionEnter, but the problem persisted) Also I am 100% sure that the platforms have the tag “Platform”, so that is not the problem.

using UnityEngine;
using System.Collections;

public class Movement : MonoBehaviour {

	public int moveSpeed;
	public int jumpHeight;
	public bool jumpEnable;

	void Start () {


	void Update () {
		transform.Translate (Vector2.right * Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime);

		if (Input.GetKey("space") && jumpEnable == true){
			rigidbody2D.AddForce(Vector2.up * jumpHeight);
			jumpEnable = false;


	void OnCollisionEnter2d (Collision2D col) {
		if (col.gameObject.tag == "Platform") {
			jumpEnable = true;


It should be OnCollisionEnter2D not OnCollisionEnter2d (notice the upper and lower case difference on the D)