Destroy game object issues

I have this script

function Update ()
{
    if (Input.GetButtonDown ("Jump")) ;
	{
		Destroy(gameObject.Find("movingplatform"));
    }
}

To my limited knowledge this script should work but unity keeps giving me this error.

BCE0044: expecting :, found ‘;’.

I could just be missing something obvious but i’m stumped :stuck_out_tongue:

Get rid of the semi-colon after your IF condition.

EDIT: also, instead of “gameObject.Find” I think you might want to use “GameObject.Find” (notice the caps)

Thanks :slight_smile: works perfectly