hi all i am trying to make on sprite active and visible and second inactive and invisible every one second

this is my code but it doesn’t work the sprite just start to flicker on and off but the bool value that should change the visibility work fine as every one second change am i missing something in the logic ? a little help would be much appreciated thanks a lot

using UnityEngine;
using System.Collections;

public class PawnAnimation : MonoBehaviour {

public GameObject pawnFrame_1;
public GameObject pawnFrame_2;

public bool pawnActive = false;

// Use this for initialization


// Update is called once per frame
void Update () 
{

	if (pawnActive == false)
	{
		pawnFrame_1.SetActive(false);
		pawnFrame_2.SetActive(true);
		Invoke("Switcher",1);
		
	} else {
		pawnFrame_1.SetActive(true);
		pawnFrame_2.SetActive(false);
		Invoke("Switcher",1);	
	}

}

void Switcher()
{	
	pawnActive = !pawnActive;
}

}

With your code, every time you enter Update you are invoking another switcher, as pawnActive is still false until Switcher is run.
You could fix it with something like this:

void Start()
{
  InvokeRepeating("Switcher", 1, 1);
}

void Switcher()
{
  pawnActive = !pawnActive;
  pawnFrame_1.SetActive(pawnActive);
  pawnFrame_2.SetActive(!pawnActive);
}