OnTriggerEnter2D being called repeatedly, OnTriggerExit2D never being called

Hey boys and girls,

I can’t get triggers working correctly in 2D. As mentioned in the question field, my OnTriggerEnter2D callback is being called repeatedly and my OnTriggerExit2D is never being called. The code looks like so. My physics 2d settings have correct layer collision. Both interacting game objects have RigidBody2D and BoxCollider2D components.

Ideas?

Cheers,

Paul

	private void OnTriggerEnter2D (Collider2D other){
		Debug.Log("OnTriggerEnter");
		Target target = other.gameObject.GetComponent<Target>();
		if(target && !targets.Contains(target)){
			targets.Add(target);
		}
	}

	private void OnTriggerExit2D (Collider2D other){
		Debug.Log("OnTriggerExit");
		Target target = other.gameObject.GetComponent<Target>();
		if(target && targets.Contains(target)){
			targets.Remove(target);
		}
	}

The OnTriggerExit2D seems to fail if you alter the local scale. Many people use the local scale to turn a sprite to face different directions. The only way around this for me was to do a transform.eulerAngles.y = 0f; or transform.eulerAngles.y = 180f; for a Platformer and if there is any light sources you will have to have them directly on top of the player or will have to duplicate them if at an offset.