How to acsess the renderer of an Instantiate()

I need to acsess the renderer of an object that I Instatiate() and It keeps saying that “renderer” is not a member of “Object”.enter code here

See the code below for the script. Thanks!

    #pragma strict
    var xpos : float;
    var spawnpoint : Vector3;
    var coin : GameObject;
    var rotation : Quaternion;
    rotation.eulerAngles = new Vector3(0, 0, 0);
    var newCoin :Object;
    
    function Start () {
    InvokeRepeating("CreateCoin", 1, 1);
    }
    
    function Update () {
    Destroy(GameObject.FindWithTag("Coin"),10);
    }
    
    function CreateCoin(){
    	xpos = Random.Range(-50.0,50.0);
    	spawnpoint = new Vector3(xpos, 80, 0);
    	
    	var myColor : Color;                       // This is just working for another part of my script, Please Ignore.
        var mode : boolean = Random.value > 0.5f;
        var rand : float = Random.value;
        var index : int = Random.Range( 0, 3 ); 
        myColor[index] = rand;
        myColor[( index + ( mode ? 1 : 2 ) ) % 3] = 1;
        myColor[( index + ( mode ? 2 : 1 ) ) % 3] = 0;
        
    	newCoin = Instantiate(coin, spawnpoint, rotation);
    	//newCoin = newCoin as GameObject; 
    	newCoin.renderer.material.color = myColor;
    	
    }

Instantiate returns an Object class, not a GameObject. So you simply cast.

newCoin = (GameObject)Instantiate(coin, spawnpoint, rotation);

Hey, for some reason I cannot comment… So this is a comment. Ill try to look up how to fix it but it just keeps saying 10 Characters needed even though I type >10.

But I’ve tried that and It says that I forgot to put in a semicolon at the end of that line.
Here’s what it reads now…

newCoin = (GameObject)Instantiate(coin, spawnpoint, rotation);