Help destroying an object that is off limits

Hi guys…

I have a couple of planes with a Z of 3.25, scrolling down, so it looks like a 2D game.
I also have a Space Ship that moves left and right and shoots
And I am in the process of setting up the enemies (they show up each 2 seconds)

My problem is that once the bullets and the enemies go out of sight, they still in the game…

I have try destroying them this way:

if (enemy.transform.position.y < -9.05)
            {
                Destroy(enemy);
            }

But, as a result, I had the prefab deleted from my assets (weird)

How I can set it up? (I tried also with Destroy(this.gameObject) and OnBecameInvisible but none of them worked)

Well, it’s not actually weird because you destroyed the prefab. What you need to do instead is instantiate the prefab, and destroy the instance.

–Eric

I did… well… I think I did…
This is what I have…
The prefab´s name is Enemy1 and is attached to the script
the Script is:

using UnityEngine;
using System.Collections;

public class Enemy : MonoBehaviour {

    public GameObject enemy;
    public float myTimer = 2;

    void Update()
    {
        myTimer = myTimer -= Time.deltaTime;
        if (myTimer <= 0)
        {
                Enemy1();
                myTimer = 2;
        }
    }

    void Enemy1()
    {
        GameObject myPrefab = (GameObject)Instantiate(enemy, new Vector3(Random.Range(-8.5f, 8.5f), 5f, 3.25f), Quaternion.identity);
            if (enemy.transform.position.y < -9.05)
            {
                Destroy(myPrefab);
            }
    }
}

(this way it does not destroy anything)