Line not being called after timer on unity C#
As far as I understand, you want to make a delay in your cod line. In unity, we use IEnumerator for this. Here is an example that makes 2 seconds delay:
void Start()
{
//Start the coroutine we define below named ExampleCoroutine.
StartCoroutine(ExampleCoroutine());
}
IEnumerator ExampleCoroutine()
{
//yield on a new YieldInstruction that waits for 2 seconds.
yield return new WaitForSeconds(2);
}
you can use StartCoroutine()
method where you need it in your code.
Read more here: Source link