This would be a way to do it.
For example, I put the name of the tag as Activator, but you can also do it with a name, putting the name of the gameobject that activates it.
Code:
...
using UnityEngine.UI;
public GameObject Nube;
void OnCollisionEnter2D(Collision2D coll){
if(coll.gameobject.tag == "Activador") // El nombre del tag es el que le pusiste al
{ // GameObject, también lo puedes hacer con
// name
Nube.SetActive(true);
}
}
void OnCollisionExit2D(Collision2D collexit){
if(collexit.gameobject.tag == "Activador")
{
Nube.SetActive(false);
}
}
}
What this code does is simply that it activates the cloud when it touches the Collider and when it goes out it deactivates it.
(The cloud you have to put on the canvas as an image)
(Keep in mind put the limit sprite, that's where you want the cloud to be activated)
Hope this can help you.
Greetings.