What was i wrong?

I try to make random Instantiate object when Collier is happen. I builded and it just not work :frowning:

  var housedestroyed : GameObject[];
    var A : GameObject;
    var B : GameObject;
    var C : GameObject;
    housedestroyed[0] = A;
    housedestroyed[1] = B;
    housedestroyed[2] = C;
    
    
    function OnCollisionEnter (collision : Collision)
    {
    
             Instantiate (housedestroyed[Random.Range(0, housedestroyed.Length)], transform.position, transform.rotation); 
    		Destroy(gameObject);
    }

the spelling for transform is wrong on line 13 “transfor” should be “transform”.
You may want to move the setting of your housedestoryed array until start. You may want to consider using a list as well.

 var housedestroyed : GameObject[];
    var A : GameObject;
    var B : GameObject;
    var C : GameObject;
 
    function Start () {
      housedestroyed = [A, B, C];
    }

    function OnCollisionEnter (collision : Collision)
    {
 
             Instantiate (nhabivo[Random.Range(0, nhabivo.Length)], transform.position, transform.rotation); 
           Destroy(gameObject);
    }