Start a countdown timer after a collision

Hi guys,

Im adapting the beginner’s roll a ball game that is used as a tutorial for Unity,

I currently have a ball rolling around picking up cubes. Ive added two extra cubes that alter the balls speed and physics upon collision.
I only want these effects to last for 5 seconds after colliding with the cube, then to go back to normal.

I’ve tried countless things but nothing seems to work.

Here is my collision code

I’ve tried using Time.deltaTime but this won’t work.

void OnTriggerEnter(Collider other) 
	{
		if (other.gameObject.CompareTag ("Pick Up")) 
 {													
			other.gameObject.SetActive (false);
			count = count + 1;//causes the count to increase by one upon collision
			setCountText ();
		}

		if (other.gameObject.CompareTag ("Special Pick Up")) {
			other.gameObject.SetActive (false);
			speed = speed * 3;


		}	
	
		if (other.gameObject.CompareTag ("Special Pick Up 2")) {
			other.gameObject.SetActive (false);
			changeDirection = true;
			speed = 5;

		
		

			}
	
	}
if anyone can help ill love you forever! thanks!!

You might want to use InvokeRepeating

 void OnTriggerEnter(Collider other) 
     {
         if (other.gameObject.CompareTag ("Pick Up")) 
  {                                                    
             other.gameObject.SetActive (false);
             setCountText ();
         }
 
         if (other.gameObject.CompareTag ("Special Pick Up")) {
             other.gameObject.SetActive (false);
             speed = speed * 3;
             InvokeRepeating("CountDown", 1, 1); //Method name, how many times the method should be called, how often (in seconds)
         }    
     
         if (other.gameObject.CompareTag ("Special Pick Up 2")) {
             other.gameObject.SetActive (false);
             changeDirection = true;
             speed = 5;
             InvokeRepeating("CountDown", 1, 1); //Method name, how many times the method should be called, how often (in seconds)
             }
     
     }

public void CountDown() {
   if (count > 5) {
   count++;
   }

   else {
   count = 0;
   speed = defaultSpeed;
   CancelInvoke(); // Stops all repeating invokes
}

}