How to make dissapear an object in unity Code Example
how to make dissapear an object in unity
public class Player : MonoBehaviour
{
//Set this game object by dragging on UI
public GameObject body;
private void OnCollisionEnter2D(Collision2D other) {
if(body != null){
body.GetComponent().enabled = false;
Destroy(body);
}
}
}