OnTriggerExit2D Does not work

Hey guys,
At first i want to appologys for my bad english, so my probleme is that the OnTriggerExit2D Function dont get called. `
using UnityEngine;
using System.Collections;

public class outofcam : MonoBehaviour {

void OnTriggerExit2D(Collider2D colli)
{
if(colli.gameObject.tag == “outofcam”)
{
Destroy(colli.transform.parent.gameObject);
}
if (colli.gameObject.tag == “cloud”)
{
int newy = Random.Range(0, 6);
colli.transform.position = new Vector2(transform.position.x + 50, newy);
}
}
}

`
In my game there are some flying clouds which should go back if they go out of the bound which is a gameobject with the code above.
So in my Level this works perfectly, but in the Mainmenu where I wanted to have the same effect this just wont work. I also did a prefab of the bound and the clouds which also didn’t work.


70051-screen2.png
I’m really confused right now and don’t know what i did wrong so please help me!
Thanks!

You checked that you have Rigidbody2D component attached to you Cloud gameobject?

OnTriggerEnter2D/OnTriggerStay2D/OnTriggerExit2D won’t get called, if there is no Rigidbody2D component.