Instantiate without (clone) in JS.

Title says it all. I have came this far, Got no errors but it aint woking.

	var spawnPoint : Transform;  

	var object1 : GameObject;  

	var object2 : GameObject;  

	var object3 : GameObject;  

	var object4 : GameObject;  

	var amountEnemies = 200000;  

	var yieldTimeMin = 2;  

	var yieldTimeMax = 5;  


	function Start()
	{
		Spawn();
	}

	function Spawn() 
	{ 
		for (i=0; i<amountEnemies; i++)
		{
			yield WaitForSeconds(Random.Range(yieldTimeMin, yieldTimeMax));

			var random = Random.Range(0, 4);
			if (random == 1)
			{
				Spawn1();
			}
			if (random == 2)
			{
				Spawn2();
			}
			if (random == 3)
			{
				Spawn3();
			}
			if (random == 4)
			{
				Spawn4();
			}
		}
	}

	function Spawn1()
	{
		Instantiate(object1, spawnPoint.position, spawnPoint.rotation);
		object1.name = "Deagle";
	}

	function Spawn2()
	{
		Instantiate(object2, spawnPoint.position, spawnPoint.rotation);
		object2.name = "MP5KA4";
	}

	function Spawn3()
	{
		Instantiate(object3, spawnPoint.position, spawnPoint.rotation);
		object3.name = "SWT-25";
	}

	function Spawn4()
	{
		Instantiate(object4, spawnPoint.position, spawnPoint.rotation);
		object4.name = "Blaser R93";
	}

Instantiate returns a link to what you just created, which you can then use to play with it. The code above doesn’t catch that link. It changes the original prefab, not the Instantiated copy.

The man page: Unity - Manual: Instantiating Prefabs at run time and the relevant lines (most people would use Transform or GameObject. Rigidbody is because they know they only want to change the speed.)

var rocketClone : Rigidbody = Instantiate(rocket, transform.position, transform.rotation);
rocketClone.velocity = transform.forward * speed;