Answers for "Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds"

C#
0

Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds

private IEnumerator OnTriggerStay(Collider other)
    {
        if (other.tag == "Player" && !_isDamaging)
        {
            _isDamaging = true;

            if (_playerHealth != null)
            {
                _playerHealth.Damage(10);
            }

            yield return new WaitForSeconds(1.5f);
            _isDamaging = false;
        }
    }
Posted by: Guest on June-30-2020

Code answers related to "Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds"

C# Answers by Framework

Browse Popular Code Answers by Language