I have seen multiple questions like this, either with no replies or one that does not help me. I need something that will delay here. The idea is in collision the speed rises and after so many seconds it goes back down. I need a delay for this time.
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "SpeedUp")
{
maxSpeed = 15;
Destroy (other.gameObject);
*here*
maxSpeed= 10;
}