Scripting Reference: 'transform' is not a member of 'Object'.

Hey folks, im sorta clueless about what´s going on here, at first i made my code based on this sample from the scripting reference but it just keept giving me a “BCE0019: ‘transform’ is not a member of ‘Object’.” error.
Then i realised my code was just like the one from the scripting reference and tried theirs, for my surprise it takes me to the exact same error.

var respawnPrefab : GameObject;
var respawns;
function Start()
{
    if (respawns == null)
        GameObject.FindGameObjectsWithTag ("Respawn");
    for (var respawn in respawns)
        Instantiate (respawnPrefab, respawn.transform.position, respawn.transform.rotation);
}

Im trying to find a couple of objects with a tag and instantiate a prefab in each one of them.

You should always define the type for variable, either explicitly, or implicitly by supplying a value.

var respawns; // wrong
var respawns : GameObject[]; // right

Also this does nothing:

    if (respawns == null)
        GameObject.FindGameObjectsWithTag ("Respawn");

You’d want to assign that to a variable, namely “respawns” in this case. Also, if you’re not using “respawns” elsewhere, then it should be defined inside Start rather than being a global variable.

–Eric

Thanks buddy!
That was an actual copy and paste from here
I knew it couldn´t be right, just haven´t had sure.

Ew, that really shouldn’t be in the docs. Documentation bug report time…

–Eric