Random instantiate position doesn't work

I’m using Orthello to create a 2D game, and I’m trying to instantiate some game objects at random positions, but the objects always show up in the middle of the screen.
I’ve debugged the variables, and the random position is getting generated. I just don’t know why Unity aren’t using it.

I appreciate any help.

Here is my code:

var abobora: Transform;
var banana: Transform;
var bolinho: Transform;
var copo: Transform;
var garrafa: Transform;
var garrafa2: Transform;
var garrafa3: Transform;
var hotdog: Transform;
var jornal: Transform;
var maca: Transform;
var milho: Transform;
var morango: Transform;
var pao: Transform;
var papel: Transform;
var pato: Transform;
var sorvete: Transform;

var lixo: Array;

function Start() {
  lixo = [

  InvokeRepeating('CriaLixo', 3.0, 5.0);

function CriaLixo() {
  var indice_aleatorio = Random.Range(0, 15);

  var posicao_aleatoria: Vector3 = Vector3(Random.Range(0, Screen.width), Random.Range(0, Screen.height), 0);
  var rotacao_aleatoria = Quaternion.AngleAxis(Random.Range(-180.0f, 180.0f), transform.right);
  var objeto_aleatorio = lixo[indice_aleatorio];
  var game_object = Instantiate(objeto_aleatorio, posicao_aleatoria, rotacao_aleatoria);

var posicao_aleatoria: Vector3 = Vector3(Random.Range(0, Screen.width), Random.Range(0, Screen.height), 0);
// posicao_aleatoria may be, for example : x : 600, y = 800, z = 0;

 var game_object = Instantiate(objeto_aleatorio, posicao_aleatoria, rotacao_aleatoria);
// game_object is now at a position of x = 600, y = 800, z = 0. So, of course, there is little chance that you can see it. You should have used Camera.ScreenToWorldPoint(). For example:

 var posicao_aleatoria: Vector3 = Camera.current.ScreenToWorldPoint(Vector3(Random.Range(0, Screen.width), Random.Range(0, Screen.height), Camera.current.nearClipPlane));

Edit : What I mean is, you used a position on your screen (a pixel value) to place an object in your 3D world (in meters). ScreenToWorldPoint() allow you to transform the coordinate on your screen to the coordinate on your world.

Edit2 : Sorry, I forgot to set a correct value for “Z”. According to the documentation, when you use ScreenToWorldPoint(), the z position is in world units from the camera. So, with Z = Camera.main.currentClipPlane(), all your objects appear at 0.3m of your Camera.
To correct it, you have to set a another value for Z. It’s up to you on how you want to implement it, but here is a example of solution:

Vector3 screenPos = new Vector3(Random.Range(0, Screen.width), Random.Range(0, Screen.height), Vector3.Distance (ts[idx].position, Camera.main.transform.position));

Vector3 pos = Camera.main.ScreenToWorldPoint(screenPos);
// Thanks to Vector3.Distance(), your "clone object" will at the same distance from the camera than your "original object".

With that, your object shouldn’t be close to the Camera anymore, and therefore will not appear at the center of the screen.