I am making a portal that will need to have a delay to set a boolean to control whether or not they can be used. I am coming over from Unreal to Unity and in Unreal, you have a delay node for these kinds of operations. I have tried to use a Wait For Seconds method and have had troubles with it.
In your main code, assuming switchBool is already set to false by default, you could do something like this in the Start(), so it happens 2 seconds after creating the object:
Invoke("delayedSwitch",2.0f);
Then a method:
public void delayedSwitch ()
{
switchBool=true;
}
This would mean the script is attached to the portal GameObject, and the switchBool is a variable in the same script.
Not sure if this is the approach you are looking for, but this is one approach that may work for you.