OnColliderExit2D doesnt seem to execute

Soo, I am making a 2D game and currently was making platforms, managed to make them and I made a script, which when the character gets on top of the platform, he becomes child of it so he moves with it. Now when I wanted to create the exiting platform bit, I found out it just doesn’t trigger, for whatever reason. Here is the code, hope it’s some silly fast to solve mistake! :smiley:

using UnityEngine;
using System.Collections;

public class MovingPlatformB : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}

	void OnCollisionEnter2D  (Collision2D  other) {
		if(other.gameObject.tag == "Player") {
			other.transform.parent = transform;
			Debug.Log ("fock");
		}
	}


	void OnCollisionExit2D (Collision2D  other) {
				if (other.gameObject.tag == "Player") {
						other.transform.parent = null;
			Debug.Log ("???");
				}
		}

	// Update is called once per frame
	void FixedUpdate () {
		transform.position = MovingPlatform.platformPosition;
	}
}

If your istrigger property box is unchecked inspector and still OnCollisionEnter2D & OnCollisionExit2D doesn’t work then check whether you have added rigidbody to the object or not. Make sure that rigidbody is added to the object.