Destroy Problem

THANKS IN ADVANCE
Hi there i’m trying to write a script for my 2D RPG. in this script an object appears in front of the player, goes through an animation sequence before being destroyed however i am getting the smae three errors however i try to approach this. Hope u can help
heres the script:
using UnityEngine;
using System.Collections;

public class Freeze : MonoBehaviour {

	private Animator anmtr;
	private bool used;

	// Use this for initialization
	void Start () {
		anmtr = GetComponent<Animator> ();
		used = false;
	
	}
	
	// Update is called once per frame
	IEnumerator Update () {
		if (Input.GetKeyDown (KeyCode.Alpha1)) {
			anmtr.SetBool ("freeze", true);
			yield return new WaitForSeconds (1f);
			anmtr.SetBool ("freeze", false);
			used = true;
			}
	
	}
	void SelfDestruct () {
		if (used) {
			Destroy (GameObject);
		}
		
		
		
}
}

thanks again

You need a lower case ‘g’ in

Destroy (GameObject);

Update can not be a Coroutine, I do believe. Make a separate function and make that a coroutine, calling it from Update, instead.

Which errors does it show? What exactly is not working?

IEnumerator Update? Not quite sure…

void Update () {
         if (Input.GetKeyDown (KeyCode.Alpha1)) {
             anmtr.SetBool ("freeze", true);
             yield return new WaitForSeconds (1f);
            StartCoroutine(WaitTime());
             }
     
     }
     void SelfDestruct () {
         if (used) {
             Destroy (GameObject);
         }

IEnumerator WaitTime()
{
             yield return new WaitForSeconds (1f);
             anmtr.SetBool ("freeze", false);
             used = true;
}

Try this. Maybe it will help.