Animation Wait C#

I’m trying to get an animation to start only after a certain amount of time has passed.

using UnityEngine;
using System.Collections;

public class CannonFire : MonoBehaviour
{
	bool playAnim = true;
	void Start(){
	
	}

	void Update(){
		if(playAnim){
			Wait();			
		}
    }

	IEnumerator Wait(){
		playAnim = false;
		yield return new WaitForSeconds(5);
		animation.Play();
	}
}

You need to call StartCoroutine with your Wait function rather than just call Wait. More information at http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.StartCoroutine.html. Also please be sure to include more information about your issues in the future.

using UnityEngine;
using System.Collections;

public class CannonFire : MonoBehaviour
   {

 public  bool playAnim ;

 public Animation move;

void Start(){

          playAnim = true;
            }

void Update(){

   if(playAnim){

   playAnim = false;
   StartCoroutine(Wait());
            
               }
                 }//update ends

   public  IEnumerator Wait(){
  
   yield return new WaitForSeconds(5);
   move.Play("run");
          }
 }

animationc#waitforseconds