I have applied this script to one of my objects and i can get it working on the object from south to north, but i cant get it working the other way round, from the top of the screen to the bottom.
{
public float speed = 10f;
private Rigidbody2D rb;
private Vector2 screenBounds;
void Start()
{
rb = this.GetComponent();
rb.velocity = new Vector2(0, -speed);
screenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z));
}
void Update ()
{
if (transform.position.y > screenBounds.y)
{
Destroy(this.gameObject);
}
}
}