Instantiate prefabs before it comes into view

Im making a platform type game and I was trying to figure out how to Instantiate a prefab as the the player(object) about every 5 units in the y direction.

Ive got the actual Instantiate working

////////////////////////////////////////////
var prefab : Transform;
var playerCam : Transform;
var player : Transform;

function Update ()
{
var playerCamY = playerCam.position.y;
var abovePlayer = playerCamY+7;
var belowPlayer = playerCamY-7;

var randPlaceX = Random.Range(-2,2);
var randPlaceY = Random.Range(abovePlayer,abovePlayer+5);

Instantiate (prefab, Vector3(randPlaceX,randPlaceY,-0.1738763),Quaternion.identity);
}

////////////////////////////////////////////////

But I just need a way of telling WHEN to Instantiate. Is there something like InvokeRepeating but for my own variable rather than seconds.

I Ultimately want to get the prefabs to Instantiate before it enters the frame then destroy it soon after it leaves the frame.

Any help would be greatly appreciated, Ive been scratching my head for ages on this oneā€¦

Two ways to do this cleanly that i can think of on just one coffee.

Attach a collider to the player that is larger than the visible area, when a spawn point enters the collider, spawn the appropriate object. When the object or spawn leaves the collider, destroy the object.

Alternatively, if you want the objects to spawn at regular intervals, set up a coroutine that checks to see if the player has moved five units in the Y direction, when they have, instantiate your object. You can test the distance by each time through the loop accumulating the distance travelled by th player. When the distanc goes above your threshold value, spawn the object, decrement the accumulated distance by your threshold.

I can post a more complete solution onc I get off of my iPad and on to a real computer.