- Home /
Question by
imM4TT · Dec 09, 2017 at 10:14 PM ·
delayupdate function
Coroutine throught update funct
Hi. I'm trying to add delay by going through update function. Ive got my coroutine function just before an order , but that only work 1 time. Can u help me to resolve my problem please void Update () {
if (axes == RotationAxes.MouseX)
{
StartCoroutine(delay());
}
}
IEnumerator delay()
{
yield return new WaitForSeconds(1);
transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612144308im_/https://answers.unity.com/themes/thub/images/avi.jpg)