Creat and get a gameobject into the screen

Hi,
I want to get a sphere from outside the screen - say from top of the screen. Now what I do know is -

  1. it’s a kind of 2d game so i’m going to use orthographic camera.
  2. for the background, for now, m using a plane.
  3. I can create game objects from the script using the createPrimitive function.

What I don’t know is how can i determine from inside the code that which point will lie outside my screen ( iphone screen ), so when the object is created and dropped from the top of the screen ( iphone screen ) it gives us a feel that it’s coming from out side the screen.
Do we have any provision (in the editor) by which can give us the world co-ordinate for the point pointed by the mouse?
Or can we define some kind of bounds and can get co-ordinate info of that bounds which in turn can be used for creating the spheres?

Thanks.

If you want to reference an outside position from the script just make an empty game object and place it where you want the object to be off screen in the games world space. Then you just reference that object in your script like this:

var topRef : GameObject; //Spawn point for spheres that you placed in the game world
var getSphere : GameObject; //Prefab for your sphere you want to spawn

then you can refer to this point using topRef.transform.position.y or to create your sphere from a prefab:

var thisSphere : GameObject = Instantiate (getSphere , topRef.transform.position, topRef.transform.rotation)