Hide an object

I am trying to hide the RedX at the end of my script 2 seconds not destroy it can some please help me with this.

Thanks

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class GUILayer : MonoBehaviour {
    
    public bool gotTarget = false;
    
    public GameObject m_LevelManager;
    private bool toggleTxt;

    
	public GameObject guiCam;
	public GameObject TextCamera1;

	
	private int rightAnswer;
	public GameObject pauseMenu;
	public GameObject ColorButton;
	public GameObject AARguiCam;
	public GameObject AAR_DecalguiCam;
	public GameObject GUICamMian;
	public GameObject MainGUI;
	public GameObject FirstRequestText;
	public GameObject SecondRequestText;
	public GameObject NegativeContactText;
	public GameObject NegativeIDContactText;
	public GameObject RedX;
	

	private bool turnOffHud = false;
	private bool IDEvent = true;
	
	

	
	//public Camera GUICamMain;
	//public Camera GUICam;
	
	
	// Use this for initialization
	void Start () {
		//FirstRequestText.SetActiveRecursively(false);	
		//SecondRequestText.SetActiveRecursively(false);
		//NegativeContactText.SetActiveRecursively(false);
		//NegativeIDContactText.SetActiveRecursively(false);
	//guiCam.SetActiveRecursively(false);
        
       
		//guiCam = GameObject.FindWithTag("guicam");
		
	} 
	
	// Update is called once per frame

	
	
	void Update () {
			if(turnOffHud){
				guiCam.SetActiveRecursively(false);
				turnOffHud = false;
			
			if(IDEvent){
				NegativeContactText.SetActiveRecursively(false);
				IDEvent = true;
				}
			
			
	}
	}
	
#region CrapIDontThinkWeNeed
    void OnGUI()
    {
		
        
    }
	
	 /*void SetUpArrays()
    {
        allSkins[0] = skin1;
        allSkins[1] = skin2;
        allSkins[2] = skin3;
        allSkins[3] = skin4;
        allSkins[4] = skin5;
        allSkins[5] = skin6;
        allSkins[6] = skin7;
        allSkins[7] = skin8;
        allSkins[8] = skin9;
        allSkins[9] = skin10;
        allSkins[10] = skin11;
        allSkins[11] = skin12;






    }

    private void SetmeOnly(int i)
    {
        for (int j = 0; j < numButtons; j++)
        {
            if (j == i)
            {
                buttonPressed[j] = true;
                previousButton = j;




            }
            else
            {
                buttonPressed[j] = false;

            }
        }
    }

    private void ClearSelectedButtons()
    {
        for (int j = 0; j < numButtons; j++)
        {
            buttonPressed[j] = false;
           




        }
    }
    */
	#endregion

   

    public void TargetSelected(bool abSelected)
    {
		if(abSelected){
			if(!gotTarget){
				m_LevelManager.BroadcastMessage("RandomizeButtons");
				if(guiCam.audio == false){
					guiCam.SetActiveRecursively (true);
				}
			}
		}else{
			turnOffHud = true;
		}
		
		
		gotTarget = abSelected;
		
    }

    public void AnswerGuessed(bool abCorrect)
    {
        if (abCorrect)
        {
            rightAnswer = 1;
        }
        else
        {
            rightAnswer = 2;
        }
    }
	
	public void DoPause(bool abPaused)
	{
		pauseMenu.SetActiveRecursively (abPaused);
		
	}

	public void ShowAAR(bool abSelected)
	{
	   AARguiCam.SetActiveRecursively (abSelected);
		if (abSelected)
			
			//GUICam.enabled = true;
			//GUICamMain.enabled = false;
		
			
			GUICamMian.SetActiveRecursively(false);
			MainGUI.SetActiveRecursively(false);
			//guiCam.SetActiveRecursively(false);
	
}
	public void ShowSprite9(bool abSelected)
	{
		
		AAR_DecalguiCam.SetActiveRecursively (abSelected);

	}
	
	public void ToggleMainGUI(bool abShow){
		MainGUI.SetActiveRecursively(abShow);	
	}
	
	public void FirstRequest(){
		FirstRequestText.SetActiveRecursively(true);
		SecondRequestText.SetActiveRecursively(false);
		NegativeContactText.SetActiveRecursively(false);
		NegativeIDContactText.SetActiveRecursively(false);
	}
	
	public void SecondRequest(){
		FirstRequestText.SetActiveRecursively(false);
		SecondRequestText.SetActiveRecursively(true);
		NegativeContactText.SetActiveRecursively(false);
		NegativeIDContactText.SetActiveRecursively(false);
	}
	
	public void NegativeContact(){
		FirstRequestText.SetActiveRecursively(false);
		SecondRequestText.SetActiveRecursively(false);
		NegativeContactText.SetActiveRecursively(true);
		NegativeIDContactText.SetActiveRecursively(false);
	}
	
	public void NegativeIDContact(){
		FirstRequestText.SetActiveRecursively(false);
		SecondRequestText.SetActiveRecursively(false);
		NegativeContactText.SetActiveRecursively(false);
		NegativeIDContactText.SetActiveRecursively(true);
		
	}
	
	public void AnswerWrong(){
		RedX.SetActiveRecursively(true);	
	}
}

maybe you can turn off the mesh renderer or deactivate the game object.

Just not sure how to code it.

You could also access the object’s material’s alpha levels and make it invisible, though the mesh render would more thoroughly “disappear” the object temporarily. I believe you could delete it with a tag and then re-instantiate the property through the same tag.

renderer.enabled = false;

or

gameObject.active = false;

Thanks for your help